{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"http://hilpisch.com/tpq_logo.png\" alt=\"The Python Quants\" width=\"35%\" align=\"right\" border=\"0\"><br>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Financial Theory with Python\n",
    "**&mdash;A Gentle Introduction**\n",
    "\n",
    "Dr Yves J Hilpisch | The Python Quants | The AI Machine\n",
    "\n",
    "http://tpq.io | http://aimachine.io | [@dyjh](http://twitter.com/dyjh)\n",
    "\n",
    "<img src=\"https://hilpisch.com/finpy_cover.png\" width=30% border=1px align=left>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Chapter 06 &mdash; Dynamic Economy"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Binomial Model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import math\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "S0 = 36.\n",
    "K = 40.\n",
    "r = 0.06\n",
    "T = 1.0\n",
    "sigma = 0.2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "m = 4\n",
    "dt = T / m\n",
    "df = math.exp(-r * dt)\n",
    "up = math.exp(sigma * math.sqrt(dt))\n",
    "down = 1 / up"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "q = (1 / df - down) / (up - down)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Binomial Option Pricing based on Python Loops"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0., 0., 0., 0., 0.],\n",
       "       [0., 0., 0., 0., 0.],\n",
       "       [0., 0., 0., 0., 0.],\n",
       "       [0., 0., 0., 0., 0.],\n",
       "       [0., 0., 0., 0., 0.]])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "S = np.zeros((m + 1, m + 1))\n",
    "S"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[36.,  0.,  0.,  0.,  0.],\n",
       "       [ 0.,  0.,  0.,  0.,  0.],\n",
       "       [ 0.,  0.,  0.,  0.,  0.],\n",
       "       [ 0.,  0.,  0.,  0.,  0.],\n",
       "       [ 0.,  0.,  0.,  0.,  0.]])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "S[0, 0] = S0\n",
    "S"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "z = 1\n",
    "for t in range(1, m + 1):\n",
    "    for i in range(0, z):\n",
    "        S[i, t] = S[i, t - 1] * up\n",
    "        S[i + 1 ,t] = S[i, t - 1] * down\n",
    "    z += 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "np.set_printoptions(formatter=\n",
    "        {'float_kind': lambda x: '%7.3f' % x})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 36.000,  39.786,  43.970,  48.595,  53.706],\n",
       "       [  0.000,  32.574,  36.000,  39.786,  43.970],\n",
       "       [  0.000,   0.000,  29.474,  32.574,  36.000],\n",
       "       [  0.000,   0.000,   0.000,  26.669,  29.474],\n",
       "       [  0.000,   0.000,   0.000,   0.000,  24.132]])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "S"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "h = np.zeros_like(S)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "z = 1\n",
    "for t in range(0, m + 1):\n",
    "    for i in range(0, z):\n",
    "        h[i, t] = max(K - S[i, t], 0)\n",
    "    z += 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  4.000,   0.214,   0.000,   0.000,   0.000],\n",
       "       [  0.000,   7.426,   4.000,   0.214,   0.000],\n",
       "       [  0.000,   0.000,  10.526,   7.426,   4.000],\n",
       "       [  0.000,   0.000,   0.000,  13.331,  10.526],\n",
       "       [  0.000,   0.000,   0.000,   0.000,  15.868]])"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "h"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  0.000,   0.000,   0.000,   0.000,   0.000],\n",
       "       [  0.000,   0.000,   0.000,   0.000,   0.000],\n",
       "       [  0.000,   0.000,   0.000,   0.000,   4.000],\n",
       "       [  0.000,   0.000,   0.000,   0.000,  10.526],\n",
       "       [  0.000,   0.000,   0.000,   0.000,  15.868]])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "V = np.zeros_like(S)\n",
    "V[:, -1] = h[:, -1]\n",
    "V"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "# European option pricing\n",
    "z = 0\n",
    "for t in range(m - 1, -1, -1):\n",
    "    for i in range(0, m - z):\n",
    "        V[i, t] = df * (q * V[i, t + 1] +\n",
    "                    (1-q) * V[i + 1, t + 1])\n",
    "    z += 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  3.977,   2.190,   0.784,   0.000,   0.000],\n",
       "       [  0.000,   6.299,   3.985,   1.771,   0.000],\n",
       "       [  0.000,   0.000,   9.344,   6.830,   4.000],\n",
       "       [  0.000,   0.000,   0.000,  12.735,  10.526],\n",
       "       [  0.000,   0.000,   0.000,   0.000,  15.868]])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "V"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.9771456941187893"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "V[0, 0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# American option pricing\n",
    "z = 0\n",
    "for t in range(m - 1, -1, -1):\n",
    "    for i in range(0, m-z):\n",
    "        V[i, t] = df * (q * V[i, t + 1] +\n",
    "                  (1 - q) * V[i + 1, t + 1])\n",
    "        V[i, t] = max(h[i, t], V[i, t])\n",
    "    z += 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  4.540,   2.307,   0.784,   0.000,   0.000],\n",
       "       [  0.000,   7.426,   4.249,   1.771,   0.000],\n",
       "       [  0.000,   0.000,  10.526,   7.426,   4.000],\n",
       "       [  0.000,   0.000,   0.000,  13.331,  10.526],\n",
       "       [  0.000,   0.000,   0.000,   0.000,  15.868]])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "V"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.539560595224299"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "V[0, 0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Vectorized Implementation with NumPy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 1, 2, 3, 4])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "u = np.arange(m + 1)\n",
    "u"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0,  1,  4,  9, 16])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "u ** 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1,  2,  4,  8, 16])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "2 ** u"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0, 1, 2, 3, 4],\n",
       "       [0, 1, 2, 3, 4],\n",
       "       [0, 1, 2, 3, 4],\n",
       "       [0, 1, 2, 3, 4],\n",
       "       [0, 1, 2, 3, 4]])"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "u = np.resize(u, (m + 1, m + 1))\n",
    "u"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0, 0, 0, 0, 0],\n",
       "       [1, 1, 1, 1, 1],\n",
       "       [2, 2, 2, 2, 2],\n",
       "       [3, 3, 3, 3, 3],\n",
       "       [4, 4, 4, 4, 4]])"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = u.T\n",
    "d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0,  1,  2,  3,  4],\n",
       "       [-2, -1,  0,  1,  2],\n",
       "       [-4, -3, -2, -1,  0],\n",
       "       [-6, -5, -4, -3, -2],\n",
       "       [-8, -7, -6, -5, -4]])"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(u - 2 * d)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 36.000,  39.786,  43.970,  48.595,  53.706],\n",
       "       [ 29.474,  32.574,  36.000,  39.786,  43.970],\n",
       "       [ 24.132,  26.669,  29.474,  32.574,  36.000],\n",
       "       [ 19.757,  21.835,  24.132,  26.669,  29.474],\n",
       "       [ 16.176,  17.877,  19.757,  21.835,  24.132]])"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "S = S0 * np.exp(sigma * math.sqrt(dt) * (u - 2 * d))\n",
    "S"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  4.000,   0.214,   0.000,   0.000,   0.000],\n",
       "       [ 10.526,   7.426,   4.000,   0.214,   0.000],\n",
       "       [ 15.868,  13.331,  10.526,   7.426,   4.000],\n",
       "       [ 20.243,  18.165,  15.868,  13.331,  10.526],\n",
       "       [ 23.824,  22.123,  20.243,  18.165,  15.868]])"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "h = np.maximum(K - S, 0)\n",
    "h"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "V = h.copy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "# European option pricing\n",
    "for t in range(m - 1, -1, -1):\n",
    "    V[0:-1, t] = df * (q * V[:-1, t + 1] +\n",
    "                   (1-q) * V[1:, t + 1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.977145694118792"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "V[0, 0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "# American option pricing\n",
    "for t in range(m - 1, -1, -1):\n",
    "    V[0:-1, t] = df * (q * V[:-1, t + 1] +\n",
    "                   (1-q) * V[1:, t + 1])\n",
    "    V[:, t] = np.maximum(h[:, t], V[:, t])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  4.540,   2.307,   0.784,   0.000,   0.000],\n",
       "       [ 10.526,   7.426,   4.249,   1.771,   0.000],\n",
       "       [ 15.868,  13.331,  10.526,   7.426,   4.000],\n",
       "       [ 20.243,  18.165,  15.868,  13.331,  10.526],\n",
       "       [ 23.824,  22.123,  20.243,  18.165,  15.868]])"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "V"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.5395605952243"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "V[0, 0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Speed Comparison"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.5044724639230862"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m = 500\n",
    "dt = T / m\n",
    "df = math.exp(-r * dt)\n",
    "up = math.exp(sigma * math.sqrt(dt))\n",
    "down = 1 / up\n",
    "q = (1 / df - down) / (up - down)\n",
    "q"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "def binomial_looping():\n",
    "    # stock price simulation in binomial tree\n",
    "    S = np.zeros((m + 1, m + 1))\n",
    "    S[0, 0] = S0\n",
    "    z = 1\n",
    "    for t in range(1, m + 1):\n",
    "        for i in range(0, z):\n",
    "            S[i, t] = S[i, t - 1] * up\n",
    "            S[i + 1 ,t] = S[i, t - 1] * down\n",
    "        z += 1\n",
    "    # inner value calculation\n",
    "    h = np.zeros_like(S)\n",
    "    z = 1\n",
    "    for t in range(0, m + 1):\n",
    "        for i in range(0, z):\n",
    "            h[i, t] = max(K - S[i, t], 0)\n",
    "        z += 1\n",
    "    # American option pricing\n",
    "    V = np.zeros_like(S)\n",
    "    V[:, -1] = h[:, -1]\n",
    "    z = 0\n",
    "    for t in range(m - 1, -1, -1):\n",
    "        for i in range(0, m - z):\n",
    "            V[i, t] = df * (q * V[i, t + 1] +\n",
    "                      (1 - q) * V[i + 1, t + 1])\n",
    "            V[i, t] = max(h[i, t], V[i, t])\n",
    "        z += 1\n",
    "    return V[0, 0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 197 ms, sys: 9.39 ms, total: 206 ms\n",
      "Wall time: 188 ms\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "4.486374777505983"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%time binomial_looping()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "170 ms ± 1.57 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit binomial_looping()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [],
   "source": [
    "def binomial_vectorization():\n",
    "    u = np.arange(m + 1)\n",
    "    u = np.resize(u, (m + 1, m + 1))\n",
    "    d = u.T\n",
    "    # stock price simulation\n",
    "    S = S0 * np.exp(sigma * math.sqrt(dt) * (u - 2 * d))\n",
    "    # inner value calculation\n",
    "    h = np.maximum(K - S, 0)\n",
    "    # American option pricing\n",
    "    V = h.copy()\n",
    "    for t in range(m-1, -1, -1):\n",
    "        V[0:-1, t] = df * (q * V[:-1, t + 1] +\n",
    "                       (1-q) * V[1:, t + 1])\n",
    "        V[:, t] = np.maximum(h[:, t], V[:, t])\n",
    "    return V[0, 0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 4.88 ms, sys: 2.26 ms, total: 7.13 ms\n",
      "Wall time: 8.17 ms\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "4.486374777506075"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%time binomial_vectorization()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4 ms ± 27.9 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit binomial_vectorization()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "39.675174013921115"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "171 / 4.31"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Monte Carlo Simulation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In the Black-Scholes-Merton (1973) model based on the geometric Brownian motion, the future price $S_t$ of the risky stock is given in a discrete simulation context by\n",
    "\n",
    "$$S_t = S_{t - \\Delta t} \\cdot \\exp \\left(\\left(r - \\frac{\\sigma^2}{2} \\right)\\Delta t + \\sigma \\sqrt{\\Delta t} z \\right)$$\n",
    "\n",
    "$S_0$ is the initial stock price, $r$ the risk-free short rate, $\\sigma$ the volatility factor, $T>0$ a future point in time and $z$ a standard normally distributed rv. $\\Delta t$ is the homogeneous time interval."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [],
   "source": [
    "S0 = 36.\n",
    "K = 40.\n",
    "r = 0.06\n",
    "T = 1.0\n",
    "sigma = 0.2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Simulating the Stock Price Process"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [],
   "source": [
    "M = 100\n",
    "I = 50000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.01"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt = T / M\n",
    "dt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9994001799640054"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = math.exp(-r * dt)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "from numpy.random import default_rng\n",
    "rng = default_rng(100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ -1.158,   0.290,   0.781, ...,   1.885,   0.049,  -0.760],\n",
       "       [  0.462,  -1.396,   0.138, ...,  -1.349,   0.146,  -0.532],\n",
       "       [  0.198,  -0.040,  -0.734, ...,   2.137,   0.173,  -0.345],\n",
       "       ...,\n",
       "       [ -0.216,  -1.308,   0.728, ...,  -0.825,  -0.602,  -0.401],\n",
       "       [ -2.134,  -1.238,   0.583, ...,   0.963,   0.886,   0.777],\n",
       "       [  2.125,  -0.415,   0.711, ...,   1.193,   0.098,  -0.517]])"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rn = rng.standard_normal((M + 1, I))\n",
    "rn"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 36.000,  36.000,  36.000, ...,  36.000,  36.000,  36.000],\n",
       "       [  0.000,   0.000,   0.000, ...,   0.000,   0.000,   0.000],\n",
       "       [  0.000,   0.000,   0.000, ...,   0.000,   0.000,   0.000],\n",
       "       ...,\n",
       "       [  0.000,   0.000,   0.000, ...,   0.000,   0.000,   0.000],\n",
       "       [  0.000,   0.000,   0.000, ...,   0.000,   0.000,   0.000],\n",
       "       [  0.000,   0.000,   0.000, ...,   0.000,   0.000,   0.000]])"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "S = np.zeros_like(rn)\n",
    "S[0] = S0\n",
    "S"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [],
   "source": [
    "for t in range(1, M + 1):\n",
    "    S[t] = S[t - 1] * np.exp((r - sigma ** 2 / 2) * dt +\n",
    "                           sigma * math.sqrt(dt) * rn[t])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 36.000,  36.000,  36.000, ...,  36.000,  36.000,  36.000],\n",
       "       [ 36.349,  35.023,  36.114, ...,  35.056,  36.119,  35.633],\n",
       "       [ 36.508,  35.009,  35.602, ...,  36.601,  36.259,  35.402],\n",
       "       ...,\n",
       "       [ 42.689,  39.760,  40.681, ...,  37.516,  47.893,  42.846],\n",
       "       [ 40.921,  38.804,  41.175, ...,  38.260,  48.769,  43.534],\n",
       "       [ 42.716,  38.499,  41.782, ...,  39.200,  48.884,  43.103]])"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "S"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pylab import mpl, plt\n",
    "plt.style.use('seaborn')\n",
    "mpl.rcParams['font.family'] = 'serif'\n",
    "%config InlineBackend.figure_formats = ['svg']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"357.238125pt\" version=\"1.1\" viewBox=\"0 0 592.125 357.238125\" width=\"592.125pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-10-19T11:05:26.344876</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.1, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 357.238125 \n",
       "L 592.125 357.238125 \n",
       "L 592.125 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 26.925 333.36 \n",
       "L 584.925 333.36 \n",
       "L 584.925 7.2 \n",
       "L 26.925 7.2 \n",
       "z\n",
       "\" style=\"fill:#eaeaf2;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 52.288636 333.36 \n",
       "L 52.288636 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\"/>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(49.107386 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 219 \n",
       "Q 2513 219 2750 744 \n",
       "Q 2988 1269 2988 2328 \n",
       "Q 2988 3391 2750 3916 \n",
       "Q 2513 4441 2034 4441 \n",
       "Q 1556 4441 1318 3916 \n",
       "Q 1081 3391 1081 2328 \n",
       "Q 1081 1269 1318 744 \n",
       "Q 1556 219 2034 219 \n",
       "z\n",
       "M 2034 -91 \n",
       "Q 1275 -91 848 546 \n",
       "Q 422 1184 422 2328 \n",
       "Q 422 3475 848 4112 \n",
       "Q 1275 4750 2034 4750 \n",
       "Q 2797 4750 3222 4112 \n",
       "Q 3647 3475 3647 2328 \n",
       "Q 3647 1184 3222 546 \n",
       "Q 2797 -91 2034 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 153.743182 333.36 \n",
       "L 153.743182 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_4\"/>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 20 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(147.380682 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 819 3553 \n",
       "L 469 3553 \n",
       "L 469 4384 \n",
       "Q 803 4563 1142 4656 \n",
       "Q 1481 4750 1806 4750 \n",
       "Q 2534 4750 2956 4397 \n",
       "Q 3378 4044 3378 3438 \n",
       "Q 3378 2753 2422 1800 \n",
       "Q 2347 1728 2309 1691 \n",
       "L 1131 513 \n",
       "L 3078 513 \n",
       "L 3078 1088 \n",
       "L 3444 1088 \n",
       "L 3444 0 \n",
       "L 434 0 \n",
       "L 434 341 \n",
       "L 1850 1753 \n",
       "Q 2319 2222 2519 2614 \n",
       "Q 2719 3006 2719 3438 \n",
       "Q 2719 3909 2473 4175 \n",
       "Q 2228 4441 1797 4441 \n",
       "Q 1350 4441 1106 4219 \n",
       "Q 863 3997 819 3553 \n",
       "z\n",
       "\" id=\"DejaVuSerif-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 255.197727 333.36 \n",
       "L 255.197727 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_6\"/>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 40 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(248.835227 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2234 1581 \n",
       "L 2234 4063 \n",
       "L 641 1581 \n",
       "L 2234 1581 \n",
       "z\n",
       "M 3609 0 \n",
       "L 1484 0 \n",
       "L 1484 331 \n",
       "L 2234 331 \n",
       "L 2234 1247 \n",
       "L 197 1247 \n",
       "L 197 1588 \n",
       "L 2241 4750 \n",
       "L 2859 4750 \n",
       "L 2859 1581 \n",
       "L 3750 1581 \n",
       "L 3750 1247 \n",
       "L 2859 1247 \n",
       "L 2859 331 \n",
       "L 3609 331 \n",
       "L 3609 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-34\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 356.652273 333.36 \n",
       "L 356.652273 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\"/>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 60 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(350.289773 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2094 219 \n",
       "Q 2534 219 2771 542 \n",
       "Q 3009 866 3009 1472 \n",
       "Q 3009 2078 2771 2401 \n",
       "Q 2534 2725 2094 2725 \n",
       "Q 1647 2725 1412 2412 \n",
       "Q 1178 2100 1178 1509 \n",
       "Q 1178 888 1415 553 \n",
       "Q 1653 219 2094 219 \n",
       "z\n",
       "M 1075 2569 \n",
       "Q 1288 2803 1556 2918 \n",
       "Q 1825 3034 2163 3034 \n",
       "Q 2859 3034 3264 2615 \n",
       "Q 3669 2197 3669 1472 \n",
       "Q 3669 763 3233 336 \n",
       "Q 2797 -91 2069 -91 \n",
       "Q 1278 -91 853 498 \n",
       "Q 428 1088 428 2181 \n",
       "Q 428 3406 931 4078 \n",
       "Q 1434 4750 2350 4750 \n",
       "Q 2597 4750 2869 4703 \n",
       "Q 3141 4656 3425 4563 \n",
       "L 3425 3794 \n",
       "L 3072 3794 \n",
       "Q 3034 4109 2831 4275 \n",
       "Q 2628 4441 2284 4441 \n",
       "Q 1678 4441 1381 3981 \n",
       "Q 1084 3522 1075 2569 \n",
       "z\n",
       "\" id=\"DejaVuSerif-36\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-36\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 458.106818 333.36 \n",
       "L 458.106818 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\"/>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 80 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(451.744318 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2981 1275 \n",
       "Q 2981 1775 2732 2051 \n",
       "Q 2484 2328 2034 2328 \n",
       "Q 1584 2328 1336 2051 \n",
       "Q 1088 1775 1088 1275 \n",
       "Q 1088 772 1336 495 \n",
       "Q 1584 219 2034 219 \n",
       "Q 2484 219 2732 495 \n",
       "Q 2981 772 2981 1275 \n",
       "z\n",
       "M 2853 3541 \n",
       "Q 2853 3966 2637 4203 \n",
       "Q 2422 4441 2034 4441 \n",
       "Q 1650 4441 1433 4203 \n",
       "Q 1216 3966 1216 3541 \n",
       "Q 1216 3113 1433 2875 \n",
       "Q 1650 2638 2034 2638 \n",
       "Q 2422 2638 2637 2875 \n",
       "Q 2853 3113 2853 3541 \n",
       "z\n",
       "M 2516 2484 \n",
       "Q 3047 2413 3344 2092 \n",
       "Q 3641 1772 3641 1275 \n",
       "Q 3641 619 3225 264 \n",
       "Q 2809 -91 2034 -91 \n",
       "Q 1263 -91 845 264 \n",
       "Q 428 619 428 1275 \n",
       "Q 428 1772 725 2092 \n",
       "Q 1022 2413 1556 2484 \n",
       "Q 1084 2569 832 2842 \n",
       "Q 581 3116 581 3541 \n",
       "Q 581 4103 968 4426 \n",
       "Q 1356 4750 2034 4750 \n",
       "Q 2713 4750 3100 4426 \n",
       "Q 3488 4103 3488 3541 \n",
       "Q 3488 3116 3236 2842 \n",
       "Q 2984 2569 2516 2484 \n",
       "z\n",
       "\" id=\"DejaVuSerif-38\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-38\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 559.561364 333.36 \n",
       "L 559.561364 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\"/>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 100 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(550.017614 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 909 0 \n",
       "L 909 331 \n",
       "L 1722 331 \n",
       "L 1722 4213 \n",
       "L 781 3603 \n",
       "L 781 4013 \n",
       "L 1919 4750 \n",
       "L 2350 4750 \n",
       "L 2350 331 \n",
       "L 3163 331 \n",
       "L 3163 0 \n",
       "L 909 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 26.925 303.340344 \n",
       "L 584.925 303.340344 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\"/>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 30 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 307.139563)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 622 4469 \n",
       "Q 988 4606 1323 4678 \n",
       "Q 1659 4750 1953 4750 \n",
       "Q 2638 4750 3022 4454 \n",
       "Q 3406 4159 3406 3634 \n",
       "Q 3406 3213 3140 2930 \n",
       "Q 2875 2647 2388 2547 \n",
       "Q 2963 2466 3280 2130 \n",
       "Q 3597 1794 3597 1259 \n",
       "Q 3597 606 3158 257 \n",
       "Q 2719 -91 1894 -91 \n",
       "Q 1528 -91 1179 -12 \n",
       "Q 831 66 488 225 \n",
       "L 488 1131 \n",
       "L 838 1131 \n",
       "Q 869 681 1141 450 \n",
       "Q 1413 219 1906 219 \n",
       "Q 2384 219 2661 495 \n",
       "Q 2938 772 2938 1253 \n",
       "Q 2938 1803 2653 2086 \n",
       "Q 2369 2369 1819 2369 \n",
       "L 1522 2369 \n",
       "L 1522 2688 \n",
       "L 1678 2688 \n",
       "Q 2225 2688 2498 2914 \n",
       "Q 2772 3141 2772 3597 \n",
       "Q 2772 4006 2547 4223 \n",
       "Q 2322 4441 1900 4441 \n",
       "Q 1478 4441 1245 4241 \n",
       "Q 1013 4041 972 3647 \n",
       "L 622 3647 \n",
       "L 622 4469 \n",
       "z\n",
       "\" id=\"DejaVuSerif-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 26.925 243.607915 \n",
       "L 584.925 243.607915 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\"/>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 40 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 247.407134)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-34\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 26.925 183.875487 \n",
       "L 584.925 183.875487 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_18\"/>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 50 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 187.674705)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3219 4666 \n",
       "L 3219 4153 \n",
       "L 1081 4153 \n",
       "L 1081 2816 \n",
       "Q 1244 2928 1461 2984 \n",
       "Q 1678 3041 1947 3041 \n",
       "Q 2703 3041 3140 2622 \n",
       "Q 3578 2203 3578 1478 \n",
       "Q 3578 738 3136 323 \n",
       "Q 2694 -91 1894 -91 \n",
       "Q 1572 -91 1234 -12 \n",
       "Q 897 66 544 225 \n",
       "L 544 1131 \n",
       "L 897 1131 \n",
       "Q 925 688 1179 453 \n",
       "Q 1434 219 1894 219 \n",
       "Q 2388 219 2653 544 \n",
       "Q 2919 869 2919 1478 \n",
       "Q 2919 2084 2655 2407 \n",
       "Q 2391 2731 1894 2731 \n",
       "Q 1613 2731 1398 2631 \n",
       "Q 1184 2531 1019 2322 \n",
       "L 750 2322 \n",
       "L 750 4666 \n",
       "L 3219 4666 \n",
       "z\n",
       "\" id=\"DejaVuSerif-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-35\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 26.925 124.143058 \n",
       "L 584.925 124.143058 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_20\"/>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 60 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 127.942277)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-36\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_21\">\n",
       "      <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 26.925 64.410629 \n",
       "L 584.925 64.410629 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_22\"/>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 70 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 68.209848)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3609 4347 \n",
       "L 1784 0 \n",
       "L 1319 0 \n",
       "L 3059 4153 \n",
       "L 903 4153 \n",
       "L 903 3578 \n",
       "L 538 3578 \n",
       "L 538 4666 \n",
       "L 3609 4666 \n",
       "L 3609 4347 \n",
       "z\n",
       "\" id=\"DejaVuSerif-37\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-37\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_23\">\n",
       "    <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 52.288636 267.500887 \n",
       "L 57.361364 265.416971 \n",
       "L 62.434091 264.466755 \n",
       "L 67.506818 270.015334 \n",
       "L 72.579545 275.391013 \n",
       "L 77.652273 272.05825 \n",
       "L 82.725 268.568545 \n",
       "L 87.797727 273.005361 \n",
       "L 92.870455 269.766831 \n",
       "L 97.943182 274.799226 \n",
       "L 103.015909 274.815905 \n",
       "L 108.088636 271.518759 \n",
       "L 113.161364 271.878109 \n",
       "L 118.234091 275.323391 \n",
       "L 123.306818 280.195789 \n",
       "L 128.379545 276.59884 \n",
       "L 133.452273 278.190378 \n",
       "L 138.525 281.692847 \n",
       "L 143.597727 277.817538 \n",
       "L 148.670455 270.794217 \n",
       "L 153.743182 269.734423 \n",
       "L 158.815909 270.662404 \n",
       "L 163.888636 273.254716 \n",
       "L 168.961364 270.406881 \n",
       "L 174.034091 270.530042 \n",
       "L 179.106818 267.760649 \n",
       "L 184.179545 265.774247 \n",
       "L 189.252273 273.707431 \n",
       "L 194.325 275.475041 \n",
       "L 199.397727 272.659092 \n",
       "L 204.470455 273.238693 \n",
       "L 209.543182 265.394929 \n",
       "L 214.615909 261.203986 \n",
       "L 219.688636 258.96461 \n",
       "L 224.761364 249.26765 \n",
       "L 229.834091 245.061007 \n",
       "L 234.906818 241.132871 \n",
       "L 239.979545 242.179912 \n",
       "L 245.052273 243.719959 \n",
       "L 250.125 246.289076 \n",
       "L 255.197727 242.063729 \n",
       "L 260.270455 242.065332 \n",
       "L 265.343182 245.423068 \n",
       "L 270.415909 238.466256 \n",
       "L 275.488636 234.769976 \n",
       "L 280.561364 237.592647 \n",
       "L 285.634091 235.425002 \n",
       "L 290.706818 229.570687 \n",
       "L 295.779545 228.166 \n",
       "L 300.852273 229.65276 \n",
       "L 305.925 235.578522 \n",
       "L 310.997727 238.406397 \n",
       "L 316.070455 231.709392 \n",
       "L 321.143182 229.041962 \n",
       "L 326.215909 225.245764 \n",
       "L 331.288636 227.960271 \n",
       "L 336.361364 233.74444 \n",
       "L 341.434091 233.018467 \n",
       "L 346.506818 230.623072 \n",
       "L 351.579545 235.497647 \n",
       "L 356.652273 231.92423 \n",
       "L 361.725 227.890052 \n",
       "L 366.797727 218.930595 \n",
       "L 371.870455 215.692957 \n",
       "L 376.943182 218.044569 \n",
       "L 382.015909 216.801727 \n",
       "L 387.088636 221.705395 \n",
       "L 392.161364 203.23032 \n",
       "L 397.234091 196.913784 \n",
       "L 402.306818 184.725157 \n",
       "L 407.379545 190.04734 \n",
       "L 412.452273 189.324292 \n",
       "L 417.525 183.951868 \n",
       "L 422.597727 184.104104 \n",
       "L 427.670455 189.77059 \n",
       "L 432.743182 196.289221 \n",
       "L 437.815909 199.025387 \n",
       "L 442.888636 199.727191 \n",
       "L 447.961364 208.283981 \n",
       "L 453.034091 208.278205 \n",
       "L 458.106818 208.669605 \n",
       "L 463.179545 210.229082 \n",
       "L 468.252273 201.477511 \n",
       "L 473.325 200.445125 \n",
       "L 478.397727 199.067046 \n",
       "L 483.470455 210.646877 \n",
       "L 488.543182 210.201252 \n",
       "L 493.615909 213.698736 \n",
       "L 498.688636 215.156754 \n",
       "L 503.761364 215.194992 \n",
       "L 508.834091 220.127528 \n",
       "L 513.906818 211.149197 \n",
       "L 518.979545 217.487186 \n",
       "L 524.052273 206.988813 \n",
       "L 529.125 214.743839 \n",
       "L 534.197727 228.123726 \n",
       "L 539.270455 230.917041 \n",
       "L 544.343182 226.543273 \n",
       "L 549.415909 227.545455 \n",
       "L 554.488636 238.10371 \n",
       "L 559.561364 227.386839 \n",
       "\" style=\"fill:none;stroke:#4c72b0;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_24\">\n",
       "    <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 52.288636 267.500887 \n",
       "L 57.361364 273.337643 \n",
       "L 62.434091 273.422513 \n",
       "L 67.506818 273.78521 \n",
       "L 72.579545 275.570486 \n",
       "L 77.652273 278.45064 \n",
       "L 82.725 276.041056 \n",
       "L 87.797727 274.886149 \n",
       "L 92.870455 275.623027 \n",
       "L 97.943182 274.78481 \n",
       "L 103.015909 273.785884 \n",
       "L 108.088636 279.046223 \n",
       "L 113.161364 273.963991 \n",
       "L 118.234091 269.070408 \n",
       "L 123.306818 273.987795 \n",
       "L 128.379545 276.355113 \n",
       "L 133.452273 270.477235 \n",
       "L 138.525 267.317575 \n",
       "L 143.597727 266.327795 \n",
       "L 148.670455 268.495903 \n",
       "L 153.743182 261.228226 \n",
       "L 158.815909 265.141192 \n",
       "L 163.888636 263.485814 \n",
       "L 168.961364 265.101776 \n",
       "L 174.034091 267.16825 \n",
       "L 179.106818 264.877922 \n",
       "L 184.179545 264.568172 \n",
       "L 189.252273 263.882391 \n",
       "L 194.325 263.628828 \n",
       "L 199.397727 270.871517 \n",
       "L 204.470455 268.396153 \n",
       "L 209.543182 276.421381 \n",
       "L 214.615909 272.797916 \n",
       "L 219.688636 278.272468 \n",
       "L 224.761364 276.78143 \n",
       "L 229.834091 278.169865 \n",
       "L 234.906818 273.76463 \n",
       "L 239.979545 271.456215 \n",
       "L 245.052273 266.699981 \n",
       "L 250.125 265.710857 \n",
       "L 255.197727 266.177066 \n",
       "L 260.270455 264.418269 \n",
       "L 265.343182 269.576741 \n",
       "L 270.415909 268.451388 \n",
       "L 275.488636 265.931109 \n",
       "L 280.561364 261.502666 \n",
       "L 285.634091 261.329324 \n",
       "L 290.706818 259.743705 \n",
       "L 295.779545 256.921372 \n",
       "L 300.852273 267.825977 \n",
       "L 305.925 264.5663 \n",
       "L 310.997727 263.256854 \n",
       "L 316.070455 266.388753 \n",
       "L 321.143182 266.841898 \n",
       "L 326.215909 257.698617 \n",
       "L 331.288636 261.594807 \n",
       "L 336.361364 256.465268 \n",
       "L 341.434091 256.917883 \n",
       "L 346.506818 260.333878 \n",
       "L 351.579545 258.676421 \n",
       "L 356.652273 258.152314 \n",
       "L 361.725 257.17321 \n",
       "L 366.797727 264.572974 \n",
       "L 371.870455 257.853529 \n",
       "L 376.943182 262.559981 \n",
       "L 382.015909 260.759836 \n",
       "L 387.088636 257.922337 \n",
       "L 392.161364 257.306157 \n",
       "L 397.234091 259.34581 \n",
       "L 402.306818 261.296508 \n",
       "L 407.379545 265.738016 \n",
       "L 412.452273 262.357778 \n",
       "L 417.525 261.809757 \n",
       "L 422.597727 260.313052 \n",
       "L 427.670455 260.568932 \n",
       "L 432.743182 259.184463 \n",
       "L 437.815909 265.448843 \n",
       "L 442.888636 265.381055 \n",
       "L 447.961364 267.266602 \n",
       "L 453.034091 266.420113 \n",
       "L 458.106818 269.11908 \n",
       "L 463.179545 266.751703 \n",
       "L 468.252273 268.790535 \n",
       "L 473.325 267.334584 \n",
       "L 478.397727 258.7973 \n",
       "L 483.470455 267.458718 \n",
       "L 488.543182 262.089137 \n",
       "L 493.615909 258.560705 \n",
       "L 498.688636 248.653869 \n",
       "L 503.761364 253.462454 \n",
       "L 508.834091 254.983596 \n",
       "L 513.906818 249.469489 \n",
       "L 518.979545 247.786504 \n",
       "L 524.052273 249.120766 \n",
       "L 529.125 241.695653 \n",
       "L 534.197727 241.00541 \n",
       "L 539.270455 242.136495 \n",
       "L 544.343182 238.839332 \n",
       "L 549.415909 245.038875 \n",
       "L 554.488636 250.753072 \n",
       "L 559.561364 252.576124 \n",
       "\" style=\"fill:none;stroke:#55a868;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_25\">\n",
       "    <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 52.288636 267.500887 \n",
       "L 57.361364 266.818464 \n",
       "L 62.434091 269.878424 \n",
       "L 67.506818 270.92245 \n",
       "L 72.579545 267.866649 \n",
       "L 77.652273 267.024896 \n",
       "L 82.725 261.085403 \n",
       "L 87.797727 258.921729 \n",
       "L 92.870455 256.39151 \n",
       "L 97.943182 251.872687 \n",
       "L 103.015909 248.853451 \n",
       "L 108.088636 252.218132 \n",
       "L 113.161364 248.437323 \n",
       "L 118.234091 253.191124 \n",
       "L 123.306818 249.175104 \n",
       "L 128.379545 253.257469 \n",
       "L 133.452273 250.301467 \n",
       "L 138.525 250.975451 \n",
       "L 143.597727 256.200248 \n",
       "L 148.670455 257.659956 \n",
       "L 153.743182 253.480161 \n",
       "L 158.815909 248.001641 \n",
       "L 163.888636 240.901642 \n",
       "L 168.961364 241.108019 \n",
       "L 174.034091 245.947734 \n",
       "L 179.106818 250.711388 \n",
       "L 184.179545 250.484074 \n",
       "L 189.252273 247.307112 \n",
       "L 194.325 242.553966 \n",
       "L 199.397727 243.966647 \n",
       "L 204.470455 240.366082 \n",
       "L 209.543182 239.959164 \n",
       "L 214.615909 240.516025 \n",
       "L 219.688636 241.421076 \n",
       "L 224.761364 245.835052 \n",
       "L 229.834091 254.35351 \n",
       "L 234.906818 255.457824 \n",
       "L 239.979545 254.072668 \n",
       "L 245.052273 255.259196 \n",
       "L 250.125 251.857283 \n",
       "L 255.197727 250.354842 \n",
       "L 260.270455 245.573596 \n",
       "L 265.343182 244.923619 \n",
       "L 270.415909 247.331005 \n",
       "L 275.488636 247.778521 \n",
       "L 280.561364 251.928244 \n",
       "L 285.634091 243.192574 \n",
       "L 290.706818 247.845156 \n",
       "L 295.779545 240.228312 \n",
       "L 300.852273 236.910766 \n",
       "L 305.925 248.276483 \n",
       "L 310.997727 247.311933 \n",
       "L 316.070455 248.531958 \n",
       "L 321.143182 252.764596 \n",
       "L 326.215909 260.176659 \n",
       "L 331.288636 261.721086 \n",
       "L 336.361364 257.787832 \n",
       "L 341.434091 262.016584 \n",
       "L 346.506818 262.920993 \n",
       "L 351.579545 256.067704 \n",
       "L 356.652273 254.394367 \n",
       "L 361.725 255.767901 \n",
       "L 366.797727 264.072226 \n",
       "L 371.870455 253.49275 \n",
       "L 376.943182 264.784261 \n",
       "L 382.015909 264.39491 \n",
       "L 387.088636 263.671122 \n",
       "L 392.161364 264.527544 \n",
       "L 397.234091 259.476981 \n",
       "L 402.306818 259.452322 \n",
       "L 407.379545 265.067066 \n",
       "L 412.452273 270.013169 \n",
       "L 417.525 268.913351 \n",
       "L 422.597727 264.860713 \n",
       "L 427.670455 266.78811 \n",
       "L 432.743182 261.981552 \n",
       "L 437.815909 256.428725 \n",
       "L 442.888636 256.471488 \n",
       "L 447.961364 251.72581 \n",
       "L 453.034091 245.06562 \n",
       "L 458.106818 235.252942 \n",
       "L 463.179545 225.235149 \n",
       "L 468.252273 231.271193 \n",
       "L 473.325 235.368282 \n",
       "L 478.397727 240.629082 \n",
       "L 483.470455 235.50683 \n",
       "L 488.543182 231.16579 \n",
       "L 493.615909 235.70528 \n",
       "L 498.688636 241.552302 \n",
       "L 503.761364 236.798264 \n",
       "L 508.834091 239.237607 \n",
       "L 513.906818 229.631333 \n",
       "L 518.979545 227.093028 \n",
       "L 524.052273 229.997802 \n",
       "L 529.125 230.004075 \n",
       "L 534.197727 238.287929 \n",
       "L 539.270455 238.674165 \n",
       "L 544.343182 243.148802 \n",
       "L 549.415909 239.538558 \n",
       "L 554.488636 236.58947 \n",
       "L 559.561364 232.966144 \n",
       "\" style=\"fill:none;stroke:#c44e52;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_26\">\n",
       "    <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 52.288636 267.500887 \n",
       "L 57.361364 266.658459 \n",
       "L 62.434091 273.028694 \n",
       "L 67.506818 276.182814 \n",
       "L 72.579545 276.495752 \n",
       "L 77.652273 271.885842 \n",
       "L 82.725 265.926126 \n",
       "L 87.797727 270.037949 \n",
       "L 92.870455 266.393334 \n",
       "L 97.943182 259.925337 \n",
       "L 103.015909 265.698343 \n",
       "L 108.088636 262.642826 \n",
       "L 113.161364 263.783161 \n",
       "L 118.234091 267.871518 \n",
       "L 123.306818 274.962876 \n",
       "L 128.379545 278.371862 \n",
       "L 133.452273 284.809032 \n",
       "L 138.525 284.862006 \n",
       "L 143.597727 278.298128 \n",
       "L 148.670455 282.571296 \n",
       "L 153.743182 280.194529 \n",
       "L 158.815909 283.842806 \n",
       "L 163.888636 282.036456 \n",
       "L 168.961364 284.096282 \n",
       "L 174.034091 281.619816 \n",
       "L 179.106818 277.931609 \n",
       "L 184.179545 274.590523 \n",
       "L 189.252273 280.99406 \n",
       "L 194.325 282.642887 \n",
       "L 199.397727 285.109266 \n",
       "L 204.470455 284.977039 \n",
       "L 209.543182 282.074473 \n",
       "L 214.615909 276.637354 \n",
       "L 219.688636 282.116296 \n",
       "L 224.761364 283.413678 \n",
       "L 229.834091 285.784044 \n",
       "L 234.906818 286.65436 \n",
       "L 239.979545 282.690635 \n",
       "L 245.052273 280.995828 \n",
       "L 250.125 273.216122 \n",
       "L 255.197727 275.785409 \n",
       "L 260.270455 272.082676 \n",
       "L 265.343182 270.611266 \n",
       "L 270.415909 266.639439 \n",
       "L 275.488636 270.775101 \n",
       "L 280.561364 268.768678 \n",
       "L 285.634091 271.642908 \n",
       "L 290.706818 262.896242 \n",
       "L 295.779545 256.346731 \n",
       "L 300.852273 264.488316 \n",
       "L 305.925 269.09258 \n",
       "L 310.997727 263.818226 \n",
       "L 316.070455 267.237373 \n",
       "L 321.143182 274.158607 \n",
       "L 326.215909 270.208712 \n",
       "L 331.288636 277.185727 \n",
       "L 336.361364 278.246615 \n",
       "L 341.434091 283.121699 \n",
       "L 346.506818 287.49844 \n",
       "L 351.579545 279.136497 \n",
       "L 356.652273 276.967755 \n",
       "L 361.725 278.434555 \n",
       "L 366.797727 273.980275 \n",
       "L 371.870455 273.276207 \n",
       "L 376.943182 275.551144 \n",
       "L 382.015909 280.081847 \n",
       "L 387.088636 279.681718 \n",
       "L 392.161364 278.332427 \n",
       "L 397.234091 279.235962 \n",
       "L 402.306818 276.151943 \n",
       "L 407.379545 275.865527 \n",
       "L 412.452273 277.019015 \n",
       "L 417.525 273.183353 \n",
       "L 422.597727 279.477987 \n",
       "L 427.670455 277.879172 \n",
       "L 432.743182 279.849763 \n",
       "L 437.815909 278.283421 \n",
       "L 442.888636 280.63111 \n",
       "L 447.961364 282.270656 \n",
       "L 453.034091 280.134795 \n",
       "L 458.106818 284.060733 \n",
       "L 463.179545 280.638911 \n",
       "L 468.252273 284.399747 \n",
       "L 473.325 287.306502 \n",
       "L 478.397727 292.686562 \n",
       "L 483.470455 287.457304 \n",
       "L 488.543182 286.051518 \n",
       "L 493.615909 289.860519 \n",
       "L 498.688636 285.138387 \n",
       "L 503.761364 285.62668 \n",
       "L 508.834091 281.169519 \n",
       "L 513.906818 280.87515 \n",
       "L 518.979545 280.391707 \n",
       "L 524.052273 285.026484 \n",
       "L 529.125 282.19838 \n",
       "L 534.197727 282.877215 \n",
       "L 539.270455 282.744661 \n",
       "L 544.343182 278.616592 \n",
       "L 549.415909 279.859306 \n",
       "L 554.488636 273.275127 \n",
       "L 559.561364 266.430813 \n",
       "\" style=\"fill:none;stroke:#8172b2;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_27\">\n",
       "    <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 52.288636 267.500887 \n",
       "L 57.361364 261.045516 \n",
       "L 62.434091 261.555362 \n",
       "L 67.506818 263.673507 \n",
       "L 72.579545 262.443205 \n",
       "L 77.652273 262.719966 \n",
       "L 82.725 263.021487 \n",
       "L 87.797727 263.967357 \n",
       "L 92.870455 262.988885 \n",
       "L 97.943182 264.802335 \n",
       "L 103.015909 262.842158 \n",
       "L 108.088636 263.489179 \n",
       "L 113.161364 259.053492 \n",
       "L 118.234091 260.567701 \n",
       "L 123.306818 261.583065 \n",
       "L 128.379545 257.072211 \n",
       "L 133.452273 264.680138 \n",
       "L 138.525 258.608543 \n",
       "L 143.597727 259.714379 \n",
       "L 148.670455 259.387645 \n",
       "L 153.743182 252.29106 \n",
       "L 158.815909 259.825851 \n",
       "L 163.888636 254.014555 \n",
       "L 168.961364 249.664453 \n",
       "L 174.034091 253.421278 \n",
       "L 179.106818 257.208972 \n",
       "L 184.179545 259.22314 \n",
       "L 189.252273 257.180189 \n",
       "L 194.325 260.481896 \n",
       "L 199.397727 264.147812 \n",
       "L 204.470455 265.116214 \n",
       "L 209.543182 272.968553 \n",
       "L 214.615909 268.644773 \n",
       "L 219.688636 269.727811 \n",
       "L 224.761364 267.971507 \n",
       "L 229.834091 270.100242 \n",
       "L 234.906818 267.176315 \n",
       "L 239.979545 274.069318 \n",
       "L 245.052273 268.110093 \n",
       "L 250.125 273.879658 \n",
       "L 255.197727 274.913028 \n",
       "L 260.270455 279.844739 \n",
       "L 265.343182 282.231753 \n",
       "L 270.415909 287.637437 \n",
       "L 275.488636 281.768023 \n",
       "L 280.561364 276.190245 \n",
       "L 285.634091 276.912975 \n",
       "L 290.706818 273.33712 \n",
       "L 295.779545 274.997114 \n",
       "L 300.852273 275.984249 \n",
       "L 305.925 270.731267 \n",
       "L 310.997727 275.719369 \n",
       "L 316.070455 282.253733 \n",
       "L 321.143182 287.243181 \n",
       "L 326.215909 285.886169 \n",
       "L 331.288636 291.487451 \n",
       "L 336.361364 286.371888 \n",
       "L 341.434091 287.960386 \n",
       "L 346.506818 282.423712 \n",
       "L 351.579545 283.376115 \n",
       "L 356.652273 285.416304 \n",
       "L 361.725 286.940192 \n",
       "L 366.797727 280.78477 \n",
       "L 371.870455 277.858945 \n",
       "L 376.943182 265.934659 \n",
       "L 382.015909 267.086249 \n",
       "L 387.088636 264.728475 \n",
       "L 392.161364 270.382015 \n",
       "L 397.234091 264.742331 \n",
       "L 402.306818 262.589983 \n",
       "L 407.379545 261.04039 \n",
       "L 412.452273 257.902784 \n",
       "L 417.525 260.651687 \n",
       "L 422.597727 262.816506 \n",
       "L 427.670455 257.496288 \n",
       "L 432.743182 258.362406 \n",
       "L 437.815909 255.021592 \n",
       "L 442.888636 258.217478 \n",
       "L 447.961364 260.489981 \n",
       "L 453.034091 266.729383 \n",
       "L 458.106818 267.956438 \n",
       "L 463.179545 272.454224 \n",
       "L 468.252273 266.535996 \n",
       "L 473.325 269.001762 \n",
       "L 478.397727 268.46271 \n",
       "L 483.470455 270.886215 \n",
       "L 488.543182 268.417502 \n",
       "L 493.615909 268.414437 \n",
       "L 498.688636 263.46046 \n",
       "L 503.761364 264.10873 \n",
       "L 508.834091 270.473754 \n",
       "L 513.906818 268.495825 \n",
       "L 518.979545 275.236679 \n",
       "L 524.052273 275.886276 \n",
       "L 529.125 272.14796 \n",
       "L 534.197727 267.41804 \n",
       "L 539.270455 273.447683 \n",
       "L 544.343182 268.009838 \n",
       "L 549.415909 268.099043 \n",
       "L 554.488636 270.282507 \n",
       "L 559.561364 272.807268 \n",
       "\" style=\"fill:none;stroke:#ccb974;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_28\">\n",
       "    <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 52.288636 267.500887 \n",
       "L 57.361364 269.480243 \n",
       "L 62.434091 260.313164 \n",
       "L 67.506818 259.483357 \n",
       "L 72.579545 259.616962 \n",
       "L 77.652273 255.80349 \n",
       "L 82.725 254.543993 \n",
       "L 87.797727 251.280319 \n",
       "L 92.870455 251.077091 \n",
       "L 97.943182 243.409198 \n",
       "L 103.015909 245.811744 \n",
       "L 108.088636 251.903337 \n",
       "L 113.161364 252.111973 \n",
       "L 118.234091 253.776387 \n",
       "L 123.306818 255.283467 \n",
       "L 128.379545 249.633943 \n",
       "L 133.452273 251.478976 \n",
       "L 138.525 249.512453 \n",
       "L 143.597727 253.144752 \n",
       "L 148.670455 249.579235 \n",
       "L 153.743182 241.965713 \n",
       "L 158.815909 245.577954 \n",
       "L 163.888636 248.201148 \n",
       "L 168.961364 251.600601 \n",
       "L 174.034091 250.388811 \n",
       "L 179.106818 245.930483 \n",
       "L 184.179545 250.091289 \n",
       "L 189.252273 255.628028 \n",
       "L 194.325 248.363961 \n",
       "L 199.397727 236.149305 \n",
       "L 204.470455 238.205455 \n",
       "L 209.543182 244.748976 \n",
       "L 214.615909 239.843394 \n",
       "L 219.688636 231.419272 \n",
       "L 224.761364 234.929789 \n",
       "L 229.834091 230.078706 \n",
       "L 234.906818 233.673654 \n",
       "L 239.979545 228.632903 \n",
       "L 245.052273 228.024542 \n",
       "L 250.125 229.274927 \n",
       "L 255.197727 222.975011 \n",
       "L 260.270455 225.3632 \n",
       "L 265.343182 223.298547 \n",
       "L 270.415909 221.503753 \n",
       "L 275.488636 226.505782 \n",
       "L 280.561364 220.131488 \n",
       "L 285.634091 221.299503 \n",
       "L 290.706818 226.90483 \n",
       "L 295.779545 224.037125 \n",
       "L 300.852273 216.939008 \n",
       "L 305.925 206.003932 \n",
       "L 310.997727 203.552718 \n",
       "L 316.070455 203.84152 \n",
       "L 321.143182 209.923144 \n",
       "L 326.215909 206.496262 \n",
       "L 331.288636 197.252297 \n",
       "L 336.361364 209.00946 \n",
       "L 341.434091 205.376246 \n",
       "L 346.506818 201.123127 \n",
       "L 351.579545 198.536063 \n",
       "L 356.652273 205.911916 \n",
       "L 361.725 204.885414 \n",
       "L 366.797727 210.079016 \n",
       "L 371.870455 204.957546 \n",
       "L 376.943182 200.045641 \n",
       "L 382.015909 199.074473 \n",
       "L 387.088636 194.706798 \n",
       "L 392.161364 187.93013 \n",
       "L 397.234091 191.552678 \n",
       "L 402.306818 195.950193 \n",
       "L 407.379545 196.338118 \n",
       "L 412.452273 195.562793 \n",
       "L 417.525 207.903314 \n",
       "L 422.597727 210.086594 \n",
       "L 427.670455 211.082414 \n",
       "L 432.743182 208.824363 \n",
       "L 437.815909 205.080652 \n",
       "L 442.888636 208.512706 \n",
       "L 447.961364 211.582186 \n",
       "L 453.034091 205.395149 \n",
       "L 458.106818 185.768921 \n",
       "L 463.179545 183.308655 \n",
       "L 468.252273 191.38777 \n",
       "L 473.325 190.787184 \n",
       "L 478.397727 184.249991 \n",
       "L 483.470455 171.240621 \n",
       "L 488.543182 171.420383 \n",
       "L 493.615909 171.269448 \n",
       "L 498.688636 171.400165 \n",
       "L 503.761364 166.748535 \n",
       "L 508.834091 162.595093 \n",
       "L 513.906818 166.659714 \n",
       "L 518.979545 182.17612 \n",
       "L 524.052273 188.830564 \n",
       "L 529.125 184.936744 \n",
       "L 534.197727 184.377311 \n",
       "L 539.270455 183.737459 \n",
       "L 544.343182 181.197198 \n",
       "L 549.415909 172.0429 \n",
       "L 554.488636 179.695541 \n",
       "L 559.561364 177.694 \n",
       "\" style=\"fill:none;stroke:#64b5cd;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_29\">\n",
       "    <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 52.288636 267.500887 \n",
       "L 57.361364 266.294085 \n",
       "L 62.434091 271.674977 \n",
       "L 67.506818 267.551383 \n",
       "L 72.579545 264.769816 \n",
       "L 77.652273 263.929069 \n",
       "L 82.725 267.204069 \n",
       "L 87.797727 272.175062 \n",
       "L 92.870455 271.916293 \n",
       "L 97.943182 277.573497 \n",
       "L 103.015909 277.825354 \n",
       "L 108.088636 273.999896 \n",
       "L 113.161364 273.463306 \n",
       "L 118.234091 272.059195 \n",
       "L 123.306818 270.983596 \n",
       "L 128.379545 267.209531 \n",
       "L 133.452273 267.977015 \n",
       "L 138.525 264.137699 \n",
       "L 143.597727 265.299471 \n",
       "L 148.670455 269.547754 \n",
       "L 153.743182 264.367816 \n",
       "L 158.815909 264.380077 \n",
       "L 163.888636 262.154392 \n",
       "L 168.961364 268.140475 \n",
       "L 174.034091 266.114388 \n",
       "L 179.106818 277.5636 \n",
       "L 184.179545 271.829795 \n",
       "L 189.252273 274.048717 \n",
       "L 194.325 277.712641 \n",
       "L 199.397727 280.505037 \n",
       "L 204.470455 287.620808 \n",
       "L 209.543182 289.955216 \n",
       "L 214.615909 285.153102 \n",
       "L 219.688636 280.481524 \n",
       "L 224.761364 278.818618 \n",
       "L 229.834091 281.810495 \n",
       "L 234.906818 281.5144 \n",
       "L 239.979545 277.483757 \n",
       "L 245.052273 278.081837 \n",
       "L 250.125 286.480497 \n",
       "L 255.197727 290.660095 \n",
       "L 260.270455 291.23897 \n",
       "L 265.343182 293.975347 \n",
       "L 270.415909 284.996627 \n",
       "L 275.488636 287.071676 \n",
       "L 280.561364 292.249484 \n",
       "L 285.634091 293.890019 \n",
       "L 290.706818 290.870153 \n",
       "L 295.779545 293.549135 \n",
       "L 300.852273 295.470221 \n",
       "L 305.925 292.815307 \n",
       "L 310.997727 288.410999 \n",
       "L 316.070455 288.271101 \n",
       "L 321.143182 284.707145 \n",
       "L 326.215909 282.746128 \n",
       "L 331.288636 275.210553 \n",
       "L 336.361364 274.883353 \n",
       "L 341.434091 273.266283 \n",
       "L 346.506818 269.75256 \n",
       "L 351.579545 268.11083 \n",
       "L 356.652273 269.988531 \n",
       "L 361.725 267.993286 \n",
       "L 366.797727 268.639893 \n",
       "L 371.870455 272.82982 \n",
       "L 376.943182 266.828921 \n",
       "L 382.015909 267.140735 \n",
       "L 387.088636 262.619225 \n",
       "L 392.161364 262.89221 \n",
       "L 397.234091 259.906593 \n",
       "L 402.306818 260.51517 \n",
       "L 407.379545 260.897554 \n",
       "L 412.452273 261.296284 \n",
       "L 417.525 260.250045 \n",
       "L 422.597727 263.238523 \n",
       "L 427.670455 263.584365 \n",
       "L 432.743182 253.118541 \n",
       "L 437.815909 252.350871 \n",
       "L 442.888636 256.234222 \n",
       "L 447.961364 254.497597 \n",
       "L 453.034091 249.63908 \n",
       "L 458.106818 246.68035 \n",
       "L 463.179545 248.921296 \n",
       "L 468.252273 244.868256 \n",
       "L 473.325 240.288864 \n",
       "L 478.397727 241.238536 \n",
       "L 483.470455 239.377946 \n",
       "L 488.543182 245.021983 \n",
       "L 493.615909 249.779149 \n",
       "L 498.688636 254.375256 \n",
       "L 503.761364 260.076095 \n",
       "L 508.834091 253.819112 \n",
       "L 513.906818 257.201307 \n",
       "L 518.979545 251.91334 \n",
       "L 524.052273 257.405783 \n",
       "L 529.125 258.028301 \n",
       "L 534.197727 259.641579 \n",
       "L 539.270455 263.528211 \n",
       "L 544.343182 259.762875 \n",
       "L 549.415909 263.283448 \n",
       "L 554.488636 255.91504 \n",
       "L 559.561364 267.193847 \n",
       "\" style=\"fill:none;stroke:#4c72b0;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_30\">\n",
       "    <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 52.288636 267.500887 \n",
       "L 57.361364 266.176262 \n",
       "L 62.434091 274.17293 \n",
       "L 67.506818 274.786417 \n",
       "L 72.579545 269.759896 \n",
       "L 77.652273 266.955161 \n",
       "L 82.725 267.916497 \n",
       "L 87.797727 265.897984 \n",
       "L 92.870455 269.093215 \n",
       "L 97.943182 272.373764 \n",
       "L 103.015909 267.742709 \n",
       "L 108.088636 268.914743 \n",
       "L 113.161364 270.026277 \n",
       "L 118.234091 274.179949 \n",
       "L 123.306818 282.221654 \n",
       "L 128.379545 283.155881 \n",
       "L 133.452273 283.345623 \n",
       "L 138.525 279.245274 \n",
       "L 143.597727 274.251389 \n",
       "L 148.670455 272.421771 \n",
       "L 153.743182 270.335101 \n",
       "L 158.815909 267.293812 \n",
       "L 163.888636 261.975851 \n",
       "L 168.961364 264.656862 \n",
       "L 174.034091 262.027615 \n",
       "L 179.106818 268.56673 \n",
       "L 184.179545 271.559515 \n",
       "L 189.252273 278.852099 \n",
       "L 194.325 272.294396 \n",
       "L 199.397727 269.924481 \n",
       "L 204.470455 267.459654 \n",
       "L 209.543182 263.004284 \n",
       "L 214.615909 263.849146 \n",
       "L 219.688636 265.137408 \n",
       "L 224.761364 263.203805 \n",
       "L 229.834091 261.766939 \n",
       "L 234.906818 264.719372 \n",
       "L 239.979545 255.838778 \n",
       "L 245.052273 248.965419 \n",
       "L 250.125 254.247006 \n",
       "L 255.197727 246.551726 \n",
       "L 260.270455 243.124449 \n",
       "L 265.343182 246.673546 \n",
       "L 270.415909 243.455102 \n",
       "L 275.488636 245.669783 \n",
       "L 280.561364 244.898725 \n",
       "L 285.634091 245.943769 \n",
       "L 290.706818 245.335287 \n",
       "L 295.779545 246.199594 \n",
       "L 300.852273 251.271881 \n",
       "L 305.925 248.542964 \n",
       "L 310.997727 243.264864 \n",
       "L 316.070455 246.072046 \n",
       "L 321.143182 244.130269 \n",
       "L 326.215909 245.346496 \n",
       "L 331.288636 241.262116 \n",
       "L 336.361364 239.630876 \n",
       "L 341.434091 248.484359 \n",
       "L 346.506818 250.237442 \n",
       "L 351.579545 247.729053 \n",
       "L 356.652273 249.217523 \n",
       "L 361.725 242.378729 \n",
       "L 366.797727 247.179419 \n",
       "L 371.870455 238.694552 \n",
       "L 376.943182 239.677005 \n",
       "L 382.015909 235.788174 \n",
       "L 387.088636 231.705242 \n",
       "L 392.161364 231.208139 \n",
       "L 397.234091 227.861836 \n",
       "L 402.306818 218.811851 \n",
       "L 407.379545 215.498724 \n",
       "L 412.452273 205.588023 \n",
       "L 417.525 198.163889 \n",
       "L 422.597727 208.423304 \n",
       "L 427.670455 198.345093 \n",
       "L 432.743182 193.041227 \n",
       "L 437.815909 203.164054 \n",
       "L 442.888636 208.14511 \n",
       "L 447.961364 211.567954 \n",
       "L 453.034091 214.178542 \n",
       "L 458.106818 221.351259 \n",
       "L 463.179545 225.149088 \n",
       "L 468.252273 223.893248 \n",
       "L 473.325 230.505819 \n",
       "L 478.397727 224.290949 \n",
       "L 483.470455 219.327713 \n",
       "L 488.543182 217.809884 \n",
       "L 493.615909 210.819733 \n",
       "L 498.688636 208.778924 \n",
       "L 503.761364 204.187257 \n",
       "L 508.834091 207.405671 \n",
       "L 513.906818 206.594083 \n",
       "L 518.979545 205.460732 \n",
       "L 524.052273 190.998477 \n",
       "L 529.125 194.131764 \n",
       "L 534.197727 196.497997 \n",
       "L 539.270455 198.120136 \n",
       "L 544.343182 190.291142 \n",
       "L 549.415909 200.656358 \n",
       "L 554.488636 197.636484 \n",
       "L 559.561364 209.238573 \n",
       "\" style=\"fill:none;stroke:#55a868;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_31\">\n",
       "    <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 52.288636 267.500887 \n",
       "L 57.361364 265.798105 \n",
       "L 62.434091 266.25429 \n",
       "L 67.506818 253.710495 \n",
       "L 72.579545 251.566179 \n",
       "L 77.652273 252.563051 \n",
       "L 82.725 249.643725 \n",
       "L 87.797727 253.19892 \n",
       "L 92.870455 257.40511 \n",
       "L 97.943182 251.440994 \n",
       "L 103.015909 258.135848 \n",
       "L 108.088636 260.454449 \n",
       "L 113.161364 264.417657 \n",
       "L 118.234091 264.388176 \n",
       "L 123.306818 263.170571 \n",
       "L 128.379545 262.765786 \n",
       "L 133.452273 262.917236 \n",
       "L 138.525 253.745976 \n",
       "L 143.597727 246.196337 \n",
       "L 148.670455 241.630814 \n",
       "L 153.743182 236.571552 \n",
       "L 158.815909 233.183375 \n",
       "L 163.888636 232.965447 \n",
       "L 168.961364 226.57168 \n",
       "L 174.034091 227.465773 \n",
       "L 179.106818 224.602431 \n",
       "L 184.179545 210.43516 \n",
       "L 189.252273 208.895843 \n",
       "L 194.325 208.397197 \n",
       "L 199.397727 203.853098 \n",
       "L 204.470455 208.97841 \n",
       "L 209.543182 212.208699 \n",
       "L 214.615909 210.149643 \n",
       "L 219.688636 209.0072 \n",
       "L 224.761364 208.222598 \n",
       "L 229.834091 208.470188 \n",
       "L 234.906818 204.539187 \n",
       "L 239.979545 190.538742 \n",
       "L 245.052273 184.675168 \n",
       "L 250.125 184.903689 \n",
       "L 255.197727 182.234671 \n",
       "L 260.270455 168.364392 \n",
       "L 265.343182 166.389097 \n",
       "L 270.415909 172.711254 \n",
       "L 275.488636 170.323092 \n",
       "L 280.561364 168.734195 \n",
       "L 285.634091 173.93441 \n",
       "L 290.706818 173.965818 \n",
       "L 295.779545 170.683723 \n",
       "L 300.852273 164.973556 \n",
       "L 305.925 170.634618 \n",
       "L 310.997727 171.308403 \n",
       "L 316.070455 158.644772 \n",
       "L 321.143182 167.319351 \n",
       "L 326.215909 175.563894 \n",
       "L 331.288636 177.781537 \n",
       "L 336.361364 182.573418 \n",
       "L 341.434091 171.189241 \n",
       "L 346.506818 169.344595 \n",
       "L 351.579545 170.491364 \n",
       "L 356.652273 168.728683 \n",
       "L 361.725 162.475354 \n",
       "L 366.797727 159.921796 \n",
       "L 371.870455 161.907391 \n",
       "L 376.943182 141.372753 \n",
       "L 382.015909 151.230608 \n",
       "L 387.088636 160.839891 \n",
       "L 392.161364 159.167323 \n",
       "L 397.234091 150.815356 \n",
       "L 402.306818 149.037001 \n",
       "L 407.379545 150.186855 \n",
       "L 412.452273 139.873876 \n",
       "L 417.525 147.352436 \n",
       "L 422.597727 149.336588 \n",
       "L 427.670455 138.856637 \n",
       "L 432.743182 136.386696 \n",
       "L 437.815909 143.983337 \n",
       "L 442.888636 136.735171 \n",
       "L 447.961364 134.715685 \n",
       "L 453.034091 130.93293 \n",
       "L 458.106818 123.202175 \n",
       "L 463.179545 112.359566 \n",
       "L 468.252273 98.629871 \n",
       "L 473.325 94.649978 \n",
       "L 478.397727 88.329042 \n",
       "L 483.470455 79.342839 \n",
       "L 488.543182 63.158612 \n",
       "L 493.615909 45.356135 \n",
       "L 498.688636 46.697025 \n",
       "L 503.761364 32.800022 \n",
       "L 508.834091 22.025455 \n",
       "L 513.906818 31.580164 \n",
       "L 518.979545 44.037164 \n",
       "L 524.052273 67.066218 \n",
       "L 529.125 57.139809 \n",
       "L 534.197727 51.98113 \n",
       "L 539.270455 56.639317 \n",
       "L 544.343182 53.564117 \n",
       "L 549.415909 43.012925 \n",
       "L 554.488636 44.552362 \n",
       "L 559.561364 40.575381 \n",
       "\" style=\"fill:none;stroke:#c44e52;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_32\">\n",
       "    <path clip-path=\"url(#p2a2f881cdd)\" d=\"M 52.288636 267.500887 \n",
       "L 57.361364 264.977113 \n",
       "L 62.434091 262.812822 \n",
       "L 67.506818 263.478542 \n",
       "L 72.579545 263.999812 \n",
       "L 77.652273 269.051435 \n",
       "L 82.725 277.567094 \n",
       "L 87.797727 273.191398 \n",
       "L 92.870455 272.896304 \n",
       "L 97.943182 266.844805 \n",
       "L 103.015909 266.008328 \n",
       "L 108.088636 260.424953 \n",
       "L 113.161364 260.369504 \n",
       "L 118.234091 256.370877 \n",
       "L 123.306818 257.898899 \n",
       "L 128.379545 261.077248 \n",
       "L 133.452273 268.252037 \n",
       "L 138.525 272.094142 \n",
       "L 143.597727 273.8034 \n",
       "L 148.670455 273.767302 \n",
       "L 153.743182 271.950297 \n",
       "L 158.815909 270.997028 \n",
       "L 163.888636 280.511394 \n",
       "L 168.961364 277.946848 \n",
       "L 174.034091 285.500054 \n",
       "L 179.106818 283.088497 \n",
       "L 184.179545 281.279108 \n",
       "L 189.252273 284.461004 \n",
       "L 194.325 290.651007 \n",
       "L 199.397727 293.045882 \n",
       "L 204.470455 292.58569 \n",
       "L 209.543182 292.013728 \n",
       "L 214.615909 289.188265 \n",
       "L 219.688636 291.300115 \n",
       "L 224.761364 288.954122 \n",
       "L 229.834091 285.153776 \n",
       "L 234.906818 289.989823 \n",
       "L 239.979545 290.640677 \n",
       "L 245.052273 291.35592 \n",
       "L 250.125 291.954708 \n",
       "L 255.197727 292.804592 \n",
       "L 260.270455 295.901529 \n",
       "L 265.343182 300.404049 \n",
       "L 270.415909 300.88369 \n",
       "L 275.488636 300.75326 \n",
       "L 280.561364 298.405307 \n",
       "L 285.634091 301.525705 \n",
       "L 290.706818 295.484706 \n",
       "L 295.779545 292.458359 \n",
       "L 300.852273 295.389936 \n",
       "L 305.925 291.872684 \n",
       "L 310.997727 293.604156 \n",
       "L 316.070455 291.989697 \n",
       "L 321.143182 296.028805 \n",
       "L 326.215909 297.628744 \n",
       "L 331.288636 301.745421 \n",
       "L 336.361364 300.011565 \n",
       "L 341.434091 297.656571 \n",
       "L 346.506818 297.678061 \n",
       "L 351.579545 294.084539 \n",
       "L 356.652273 294.552764 \n",
       "L 361.725 296.741406 \n",
       "L 366.797727 292.303396 \n",
       "L 371.870455 291.046455 \n",
       "L 376.943182 289.081614 \n",
       "L 382.015909 289.334072 \n",
       "L 387.088636 292.996405 \n",
       "L 392.161364 292.541789 \n",
       "L 397.234091 288.413363 \n",
       "L 402.306818 289.256899 \n",
       "L 407.379545 287.266174 \n",
       "L 412.452273 289.174562 \n",
       "L 417.525 287.050723 \n",
       "L 422.597727 287.888238 \n",
       "L 427.670455 288.973038 \n",
       "L 432.743182 292.816339 \n",
       "L 437.815909 299.89446 \n",
       "L 442.888636 293.575823 \n",
       "L 447.961364 296.132666 \n",
       "L 453.034091 294.757779 \n",
       "L 458.106818 293.512454 \n",
       "L 463.179545 295.197944 \n",
       "L 468.252273 292.13531 \n",
       "L 473.325 290.365428 \n",
       "L 478.397727 291.057446 \n",
       "L 483.470455 294.053132 \n",
       "L 488.543182 292.413943 \n",
       "L 493.615909 299.262694 \n",
       "L 498.688636 306.398013 \n",
       "L 503.761364 307.480251 \n",
       "L 508.834091 311.39562 \n",
       "L 513.906818 312.966652 \n",
       "L 518.979545 312.752566 \n",
       "L 524.052273 315.808617 \n",
       "L 529.125 317.043652 \n",
       "L 534.197727 318.534545 \n",
       "L 539.270455 312.714588 \n",
       "L 544.343182 311.806556 \n",
       "L 549.415909 311.850415 \n",
       "L 554.488636 308.568984 \n",
       "L 559.561364 312.537397 \n",
       "\" style=\"fill:none;stroke:#8172b2;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 26.925 333.36 \n",
       "L 26.925 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 584.925 333.36 \n",
       "L 584.925 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 26.925 333.36 \n",
       "L 584.925 333.36 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 26.925 7.2 \n",
       "L 584.925 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p2a2f881cdd\">\n",
       "   <rect height=\"326.16\" width=\"558\" x=\"26.925\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(10, 6))\n",
    "plt.plot(S[:, :10]);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"357.238125pt\" version=\"1.1\" viewBox=\"0 0 604.85 357.238125\" width=\"604.85pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-10-19T11:05:26.415876</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.1, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 357.238125 \n",
       "L 604.85 357.238125 \n",
       "L 604.85 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 39.65 333.36 \n",
       "L 597.65 333.36 \n",
       "L 597.65 7.2 \n",
       "L 39.65 7.2 \n",
       "z\n",
       "\" style=\"fill:#eaeaf2;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 90.248099 333.36 \n",
       "L 90.248099 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\"/>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 20 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(83.885599 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 819 3553 \n",
       "L 469 3553 \n",
       "L 469 4384 \n",
       "Q 803 4563 1142 4656 \n",
       "Q 1481 4750 1806 4750 \n",
       "Q 2534 4750 2956 4397 \n",
       "Q 3378 4044 3378 3438 \n",
       "Q 3378 2753 2422 1800 \n",
       "Q 2347 1728 2309 1691 \n",
       "L 1131 513 \n",
       "L 3078 513 \n",
       "L 3078 1088 \n",
       "L 3444 1088 \n",
       "L 3444 0 \n",
       "L 434 0 \n",
       "L 434 341 \n",
       "L 1850 1753 \n",
       "Q 2319 2222 2519 2614 \n",
       "Q 2719 3006 2719 3438 \n",
       "Q 2719 3909 2473 4175 \n",
       "Q 2228 4441 1797 4441 \n",
       "Q 1350 4441 1106 4219 \n",
       "Q 863 3997 819 3553 \n",
       "z\n",
       "\" id=\"DejaVuSerif-32\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 2034 219 \n",
       "Q 2513 219 2750 744 \n",
       "Q 2988 1269 2988 2328 \n",
       "Q 2988 3391 2750 3916 \n",
       "Q 2513 4441 2034 4441 \n",
       "Q 1556 4441 1318 3916 \n",
       "Q 1081 3391 1081 2328 \n",
       "Q 1081 1269 1318 744 \n",
       "Q 1556 219 2034 219 \n",
       "z\n",
       "M 2034 -91 \n",
       "Q 1275 -91 848 546 \n",
       "Q 422 1184 422 2328 \n",
       "Q 422 3475 848 4112 \n",
       "Q 1275 4750 2034 4750 \n",
       "Q 2797 4750 3222 4112 \n",
       "Q 3647 3475 3647 2328 \n",
       "Q 3647 1184 3222 546 \n",
       "Q 2797 -91 2034 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 153.9319 333.36 \n",
       "L 153.9319 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_4\"/>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 30 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(147.5694 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 622 4469 \n",
       "Q 988 4606 1323 4678 \n",
       "Q 1659 4750 1953 4750 \n",
       "Q 2638 4750 3022 4454 \n",
       "Q 3406 4159 3406 3634 \n",
       "Q 3406 3213 3140 2930 \n",
       "Q 2875 2647 2388 2547 \n",
       "Q 2963 2466 3280 2130 \n",
       "Q 3597 1794 3597 1259 \n",
       "Q 3597 606 3158 257 \n",
       "Q 2719 -91 1894 -91 \n",
       "Q 1528 -91 1179 -12 \n",
       "Q 831 66 488 225 \n",
       "L 488 1131 \n",
       "L 838 1131 \n",
       "Q 869 681 1141 450 \n",
       "Q 1413 219 1906 219 \n",
       "Q 2384 219 2661 495 \n",
       "Q 2938 772 2938 1253 \n",
       "Q 2938 1803 2653 2086 \n",
       "Q 2369 2369 1819 2369 \n",
       "L 1522 2369 \n",
       "L 1522 2688 \n",
       "L 1678 2688 \n",
       "Q 2225 2688 2498 2914 \n",
       "Q 2772 3141 2772 3597 \n",
       "Q 2772 4006 2547 4223 \n",
       "Q 2322 4441 1900 4441 \n",
       "Q 1478 4441 1245 4241 \n",
       "Q 1013 4041 972 3647 \n",
       "L 622 3647 \n",
       "L 622 4469 \n",
       "z\n",
       "\" id=\"DejaVuSerif-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 217.615701 333.36 \n",
       "L 217.615701 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_6\"/>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 40 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(211.253201 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2234 1581 \n",
       "L 2234 4063 \n",
       "L 641 1581 \n",
       "L 2234 1581 \n",
       "z\n",
       "M 3609 0 \n",
       "L 1484 0 \n",
       "L 1484 331 \n",
       "L 2234 331 \n",
       "L 2234 1247 \n",
       "L 197 1247 \n",
       "L 197 1588 \n",
       "L 2241 4750 \n",
       "L 2859 4750 \n",
       "L 2859 1581 \n",
       "L 3750 1581 \n",
       "L 3750 1247 \n",
       "L 2859 1247 \n",
       "L 2859 331 \n",
       "L 3609 331 \n",
       "L 3609 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-34\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 281.299502 333.36 \n",
       "L 281.299502 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\"/>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 50 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(274.937002 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3219 4666 \n",
       "L 3219 4153 \n",
       "L 1081 4153 \n",
       "L 1081 2816 \n",
       "Q 1244 2928 1461 2984 \n",
       "Q 1678 3041 1947 3041 \n",
       "Q 2703 3041 3140 2622 \n",
       "Q 3578 2203 3578 1478 \n",
       "Q 3578 738 3136 323 \n",
       "Q 2694 -91 1894 -91 \n",
       "Q 1572 -91 1234 -12 \n",
       "Q 897 66 544 225 \n",
       "L 544 1131 \n",
       "L 897 1131 \n",
       "Q 925 688 1179 453 \n",
       "Q 1434 219 1894 219 \n",
       "Q 2388 219 2653 544 \n",
       "Q 2919 869 2919 1478 \n",
       "Q 2919 2084 2655 2407 \n",
       "Q 2391 2731 1894 2731 \n",
       "Q 1613 2731 1398 2631 \n",
       "Q 1184 2531 1019 2322 \n",
       "L 750 2322 \n",
       "L 750 4666 \n",
       "L 3219 4666 \n",
       "z\n",
       "\" id=\"DejaVuSerif-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-35\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 344.983303 333.36 \n",
       "L 344.983303 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\"/>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 60 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(338.620803 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2094 219 \n",
       "Q 2534 219 2771 542 \n",
       "Q 3009 866 3009 1472 \n",
       "Q 3009 2078 2771 2401 \n",
       "Q 2534 2725 2094 2725 \n",
       "Q 1647 2725 1412 2412 \n",
       "Q 1178 2100 1178 1509 \n",
       "Q 1178 888 1415 553 \n",
       "Q 1653 219 2094 219 \n",
       "z\n",
       "M 1075 2569 \n",
       "Q 1288 2803 1556 2918 \n",
       "Q 1825 3034 2163 3034 \n",
       "Q 2859 3034 3264 2615 \n",
       "Q 3669 2197 3669 1472 \n",
       "Q 3669 763 3233 336 \n",
       "Q 2797 -91 2069 -91 \n",
       "Q 1278 -91 853 498 \n",
       "Q 428 1088 428 2181 \n",
       "Q 428 3406 931 4078 \n",
       "Q 1434 4750 2350 4750 \n",
       "Q 2597 4750 2869 4703 \n",
       "Q 3141 4656 3425 4563 \n",
       "L 3425 3794 \n",
       "L 3072 3794 \n",
       "Q 3034 4109 2831 4275 \n",
       "Q 2628 4441 2284 4441 \n",
       "Q 1678 4441 1381 3981 \n",
       "Q 1084 3522 1075 2569 \n",
       "z\n",
       "\" id=\"DejaVuSerif-36\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-36\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 408.667104 333.36 \n",
       "L 408.667104 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\"/>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 70 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(402.304604 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3609 4347 \n",
       "L 1784 0 \n",
       "L 1319 0 \n",
       "L 3059 4153 \n",
       "L 903 4153 \n",
       "L 903 3578 \n",
       "L 538 3578 \n",
       "L 538 4666 \n",
       "L 3609 4666 \n",
       "L 3609 4347 \n",
       "z\n",
       "\" id=\"DejaVuSerif-37\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-37\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_7\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 472.350905 333.36 \n",
       "L 472.350905 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\"/>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 80 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(465.988405 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2981 1275 \n",
       "Q 2981 1775 2732 2051 \n",
       "Q 2484 2328 2034 2328 \n",
       "Q 1584 2328 1336 2051 \n",
       "Q 1088 1775 1088 1275 \n",
       "Q 1088 772 1336 495 \n",
       "Q 1584 219 2034 219 \n",
       "Q 2484 219 2732 495 \n",
       "Q 2981 772 2981 1275 \n",
       "z\n",
       "M 2853 3541 \n",
       "Q 2853 3966 2637 4203 \n",
       "Q 2422 4441 2034 4441 \n",
       "Q 1650 4441 1433 4203 \n",
       "Q 1216 3966 1216 3541 \n",
       "Q 1216 3113 1433 2875 \n",
       "Q 1650 2638 2034 2638 \n",
       "Q 2422 2638 2637 2875 \n",
       "Q 2853 3113 2853 3541 \n",
       "z\n",
       "M 2516 2484 \n",
       "Q 3047 2413 3344 2092 \n",
       "Q 3641 1772 3641 1275 \n",
       "Q 3641 619 3225 264 \n",
       "Q 2809 -91 2034 -91 \n",
       "Q 1263 -91 845 264 \n",
       "Q 428 619 428 1275 \n",
       "Q 428 1772 725 2092 \n",
       "Q 1022 2413 1556 2484 \n",
       "Q 1084 2569 832 2842 \n",
       "Q 581 3116 581 3541 \n",
       "Q 581 4103 968 4426 \n",
       "Q 1356 4750 2034 4750 \n",
       "Q 2713 4750 3100 4426 \n",
       "Q 3488 4103 3488 3541 \n",
       "Q 3488 3116 3236 2842 \n",
       "Q 2984 2569 2516 2484 \n",
       "z\n",
       "\" id=\"DejaVuSerif-38\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-38\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_8\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 536.034706 333.36 \n",
       "L 536.034706 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\"/>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 90 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(529.672206 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2994 2091 \n",
       "Q 2784 1856 2512 1740 \n",
       "Q 2241 1625 1900 1625 \n",
       "Q 1206 1625 804 2044 \n",
       "Q 403 2463 403 3188 \n",
       "Q 403 3897 839 4323 \n",
       "Q 1275 4750 2003 4750 \n",
       "Q 2794 4750 3217 4161 \n",
       "Q 3641 3572 3641 2478 \n",
       "Q 3641 1253 3137 581 \n",
       "Q 2634 -91 1722 -91 \n",
       "Q 1475 -91 1203 -44 \n",
       "Q 931 3 647 97 \n",
       "L 647 872 \n",
       "L 997 872 \n",
       "Q 1038 556 1241 387 \n",
       "Q 1444 219 1784 219 \n",
       "Q 2391 219 2687 676 \n",
       "Q 2984 1134 2994 2091 \n",
       "z\n",
       "M 1978 4441 \n",
       "Q 1534 4441 1298 4117 \n",
       "Q 1063 3794 1063 3188 \n",
       "Q 1063 2581 1298 2256 \n",
       "Q 1534 1931 1978 1931 \n",
       "Q 2422 1931 2658 2245 \n",
       "Q 2894 2559 2894 3150 \n",
       "Q 2894 3772 2656 4106 \n",
       "Q 2419 4441 1978 4441 \n",
       "z\n",
       "\" id=\"DejaVuSerif-39\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-39\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 39.65 333.36 \n",
       "L 597.65 333.36 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_18\"/>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(26.2875 337.159219)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 39.65 282.33691 \n",
       "L 597.65 282.33691 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_20\"/>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 1000 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 286.136129)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 909 0 \n",
       "L 909 331 \n",
       "L 1722 331 \n",
       "L 1722 4213 \n",
       "L 781 3603 \n",
       "L 781 4013 \n",
       "L 1919 4750 \n",
       "L 2350 4750 \n",
       "L 2350 331 \n",
       "L 3163 331 \n",
       "L 3163 0 \n",
       "L 909 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_21\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 39.65 231.31382 \n",
       "L 597.65 231.31382 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_22\"/>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 2000 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 235.113039)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_23\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 39.65 180.29073 \n",
       "L 597.65 180.29073 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_24\"/>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 3000 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 184.089949)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_25\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 39.65 129.26764 \n",
       "L 597.65 129.26764 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_26\"/>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 4000 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 133.066859)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-34\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_27\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 39.65 78.24455 \n",
       "L 597.65 78.24455 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_28\"/>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 5000 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 82.043769)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-35\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_29\">\n",
       "      <path clip-path=\"url(#p63270f2772)\" d=\"M 39.65 27.22146 \n",
       "L 597.65 27.22146 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_30\"/>\n",
       "     <g id=\"text_15\">\n",
       "      <!-- 6000 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 31.020679)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-36\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 65.013636 333.36 \n",
       "L 79.507143 333.36 \n",
       "L 79.507143 332.798746 \n",
       "L 65.013636 332.798746 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 79.507143 333.36 \n",
       "L 94.000649 333.36 \n",
       "L 94.000649 330.55373 \n",
       "L 79.507143 330.55373 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 94.000649 333.36 \n",
       "L 108.494156 333.36 \n",
       "L 108.494156 319.99195 \n",
       "L 94.000649 319.99195 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 108.494156 333.36 \n",
       "L 122.987662 333.36 \n",
       "L 122.987662 291.929251 \n",
       "L 108.494156 291.929251 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_7\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 122.987662 333.36 \n",
       "L 137.481169 333.36 \n",
       "L 137.481169 242.487877 \n",
       "L 122.987662 242.487877 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_8\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 137.481169 333.36 \n",
       "L 151.974675 333.36 \n",
       "L 151.974675 172.382151 \n",
       "L 137.481169 172.382151 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_9\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 151.974675 333.36 \n",
       "L 166.468182 333.36 \n",
       "L 166.468182 103.960188 \n",
       "L 151.974675 103.960188 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_10\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 166.468182 333.36 \n",
       "L 180.961688 333.36 \n",
       "L 180.961688 45.334657 \n",
       "L 166.468182 45.334657 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_11\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 180.961688 333.36 \n",
       "L 195.455195 333.36 \n",
       "L 195.455195 22.731429 \n",
       "L 180.961688 22.731429 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_12\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 195.455195 333.36 \n",
       "L 209.948701 333.36 \n",
       "L 209.948701 26.354068 \n",
       "L 195.455195 26.354068 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_13\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 209.948701 333.36 \n",
       "L 224.442208 333.36 \n",
       "L 224.442208 51.559474 \n",
       "L 209.948701 51.559474 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_14\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 224.442208 333.36 \n",
       "L 238.935714 333.36 \n",
       "L 238.935714 103.245864 \n",
       "L 224.442208 103.245864 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_15\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 238.935714 333.36 \n",
       "L 253.429221 333.36 \n",
       "L 253.429221 154.166908 \n",
       "L 238.935714 154.166908 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_16\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 253.429221 333.36 \n",
       "L 267.922727 333.36 \n",
       "L 267.922727 198.505973 \n",
       "L 253.429221 198.505973 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_17\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 267.922727 333.36 \n",
       "L 282.416234 333.36 \n",
       "L 282.416234 239.018307 \n",
       "L 267.922727 239.018307 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_18\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 282.416234 333.36 \n",
       "L 296.90974 333.36 \n",
       "L 296.90974 264.733944 \n",
       "L 282.416234 264.733944 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_19\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 296.90974 333.36 \n",
       "L 311.403247 333.36 \n",
       "L 311.403247 288.204565 \n",
       "L 296.90974 288.204565 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_20\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 311.403247 333.36 \n",
       "L 325.896753 333.36 \n",
       "L 325.896753 307.185155 \n",
       "L 311.403247 307.185155 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_21\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 325.896753 333.36 \n",
       "L 340.39026 333.36 \n",
       "L 340.39026 316.063173 \n",
       "L 325.896753 316.063173 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_22\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 340.39026 333.36 \n",
       "L 354.883766 333.36 \n",
       "L 354.883766 320.961389 \n",
       "L 340.39026 320.961389 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_23\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 354.883766 333.36 \n",
       "L 369.377273 333.36 \n",
       "L 369.377273 326.931091 \n",
       "L 354.883766 326.931091 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_24\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 369.377273 333.36 \n",
       "L 383.870779 333.36 \n",
       "L 383.870779 329.125084 \n",
       "L 369.377273 329.125084 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_25\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 383.870779 333.36 \n",
       "L 398.364286 333.36 \n",
       "L 398.364286 330.961915 \n",
       "L 383.870779 330.961915 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_26\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 398.364286 333.36 \n",
       "L 412.857792 333.36 \n",
       "L 412.857792 332.186469 \n",
       "L 398.364286 332.186469 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_27\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 412.857792 333.36 \n",
       "L 427.351299 333.36 \n",
       "L 427.351299 332.543631 \n",
       "L 412.857792 332.543631 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_28\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 427.351299 333.36 \n",
       "L 441.844805 333.36 \n",
       "L 441.844805 332.849769 \n",
       "L 427.351299 332.849769 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_29\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 441.844805 333.36 \n",
       "L 456.338312 333.36 \n",
       "L 456.338312 333.155908 \n",
       "L 441.844805 333.155908 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_30\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 456.338312 333.36 \n",
       "L 470.831818 333.36 \n",
       "L 470.831818 333.206931 \n",
       "L 456.338312 333.206931 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_31\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 470.831818 333.36 \n",
       "L 485.325325 333.36 \n",
       "L 485.325325 333.308977 \n",
       "L 470.831818 333.308977 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_32\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 485.325325 333.36 \n",
       "L 499.818831 333.36 \n",
       "L 499.818831 333.36 \n",
       "L 485.325325 333.36 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_33\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 499.818831 333.36 \n",
       "L 514.312338 333.36 \n",
       "L 514.312338 333.36 \n",
       "L 499.818831 333.36 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_34\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 514.312338 333.36 \n",
       "L 528.805844 333.36 \n",
       "L 528.805844 333.308977 \n",
       "L 514.312338 333.308977 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_35\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 528.805844 333.36 \n",
       "L 543.299351 333.36 \n",
       "L 543.299351 333.36 \n",
       "L 528.805844 333.36 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_36\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 543.299351 333.36 \n",
       "L 557.792857 333.36 \n",
       "L 557.792857 333.36 \n",
       "L 543.299351 333.36 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_37\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 557.792857 333.36 \n",
       "L 572.286364 333.36 \n",
       "L 572.286364 333.257954 \n",
       "L 557.792857 333.257954 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_31\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 206.486889 333.36 \n",
       "L 206.486889 7.2 \n",
       "\" style=\"fill:none;stroke:#ff0000;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_32\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 255.555701 333.36 \n",
       "L 255.555701 7.2 \n",
       "\" style=\"fill:none;stroke:#bfbf00;stroke-dasharray:6.475,2.8;stroke-dashoffset:0;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_33\">\n",
       "    <path clip-path=\"url(#p63270f2772)\" d=\"M 157.418077 333.36 \n",
       "L 157.418077 7.2 \n",
       "\" style=\"fill:none;stroke:#bfbf00;stroke-dasharray:11.2,2.8,1.75,2.8;stroke-dashoffset:0;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_38\">\n",
       "    <path d=\"M 39.65 333.36 \n",
       "L 39.65 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_39\">\n",
       "    <path d=\"M 597.65 333.36 \n",
       "L 597.65 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_40\">\n",
       "    <path d=\"M 39.65 333.36 \n",
       "L 597.65 333.36 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_41\">\n",
       "    <path d=\"M 39.65 7.2 \n",
       "L 597.65 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"line2d_34\">\n",
       "     <path d=\"M 509.798437 20.298437 \n",
       "L 529.798437 20.298437 \n",
       "\" style=\"fill:none;stroke:#ff0000;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_35\"/>\n",
       "    <g id=\"text_16\">\n",
       "     <!-- mean -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(537.798437 23.798437)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 3316 2675 \n",
       "Q 3481 3041 3739 3227 \n",
       "Q 3997 3413 4341 3413 \n",
       "Q 4863 3413 5119 3089 \n",
       "Q 5375 2766 5375 2113 \n",
       "L 5375 331 \n",
       "L 5894 331 \n",
       "L 5894 0 \n",
       "L 4300 0 \n",
       "L 4300 331 \n",
       "L 4800 331 \n",
       "L 4800 2047 \n",
       "Q 4800 2556 4650 2772 \n",
       "Q 4500 2988 4153 2988 \n",
       "Q 3769 2988 3567 2697 \n",
       "Q 3366 2406 3366 1850 \n",
       "L 3366 331 \n",
       "L 3866 331 \n",
       "L 3866 0 \n",
       "L 2291 0 \n",
       "L 2291 331 \n",
       "L 2791 331 \n",
       "L 2791 2069 \n",
       "Q 2791 2566 2641 2777 \n",
       "Q 2491 2988 2144 2988 \n",
       "Q 1759 2988 1557 2697 \n",
       "Q 1356 2406 1356 1850 \n",
       "L 1356 331 \n",
       "L 1856 331 \n",
       "L 1856 0 \n",
       "L 263 0 \n",
       "L 263 331 \n",
       "L 781 331 \n",
       "L 781 2994 \n",
       "L 231 2994 \n",
       "L 231 3322 \n",
       "L 1356 3322 \n",
       "L 1356 2731 \n",
       "Q 1516 3063 1762 3238 \n",
       "Q 2009 3413 2322 3413 \n",
       "Q 2709 3413 2968 3220 \n",
       "Q 3228 3028 3316 2675 \n",
       "z\n",
       "\" id=\"DejaVuSerif-6d\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3469 1600 \n",
       "L 991 1600 \n",
       "L 991 1575 \n",
       "Q 991 903 1244 561 \n",
       "Q 1497 219 1991 219 \n",
       "Q 2369 219 2611 417 \n",
       "Q 2853 616 2950 1006 \n",
       "L 3413 1006 \n",
       "Q 3275 459 2904 184 \n",
       "Q 2534 -91 1931 -91 \n",
       "Q 1203 -91 761 389 \n",
       "Q 319 869 319 1663 \n",
       "Q 319 2450 753 2931 \n",
       "Q 1188 3413 1894 3413 \n",
       "Q 2647 3413 3050 2948 \n",
       "Q 3453 2484 3469 1600 \n",
       "z\n",
       "M 2791 1931 \n",
       "Q 2772 2513 2545 2808 \n",
       "Q 2319 3103 1894 3103 \n",
       "Q 1497 3103 1269 2806 \n",
       "Q 1041 2509 991 1931 \n",
       "L 2791 1931 \n",
       "z\n",
       "\" id=\"DejaVuSerif-65\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2547 1044 \n",
       "L 2547 1747 \n",
       "L 1806 1747 \n",
       "Q 1378 1747 1168 1562 \n",
       "Q 959 1378 959 997 \n",
       "Q 959 650 1171 447 \n",
       "Q 1384 244 1747 244 \n",
       "Q 2106 244 2326 466 \n",
       "Q 2547 688 2547 1044 \n",
       "z\n",
       "M 3122 2075 \n",
       "L 3122 331 \n",
       "L 3634 331 \n",
       "L 3634 0 \n",
       "L 2547 0 \n",
       "L 2547 359 \n",
       "Q 2356 128 2106 18 \n",
       "Q 1856 -91 1522 -91 \n",
       "Q 969 -91 644 203 \n",
       "Q 319 497 319 997 \n",
       "Q 319 1513 691 1797 \n",
       "Q 1063 2081 1741 2081 \n",
       "L 2547 2081 \n",
       "L 2547 2309 \n",
       "Q 2547 2688 2317 2895 \n",
       "Q 2088 3103 1672 3103 \n",
       "Q 1328 3103 1125 2947 \n",
       "Q 922 2791 872 2484 \n",
       "L 575 2484 \n",
       "L 575 3156 \n",
       "Q 875 3284 1158 3348 \n",
       "Q 1441 3413 1709 3413 \n",
       "Q 2400 3413 2761 3070 \n",
       "Q 3122 2728 3122 2075 \n",
       "z\n",
       "\" id=\"DejaVuSerif-61\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 263 0 \n",
       "L 263 331 \n",
       "L 781 331 \n",
       "L 781 2988 \n",
       "L 231 2988 \n",
       "L 231 3322 \n",
       "L 1356 3322 \n",
       "L 1356 2731 \n",
       "Q 1516 3069 1770 3241 \n",
       "Q 2025 3413 2363 3413 \n",
       "Q 2913 3413 3172 3097 \n",
       "Q 3431 2781 3431 2113 \n",
       "L 3431 331 \n",
       "L 3944 331 \n",
       "L 3944 0 \n",
       "L 2356 0 \n",
       "L 2356 331 \n",
       "L 2853 331 \n",
       "L 2853 1931 \n",
       "Q 2853 2541 2703 2767 \n",
       "Q 2553 2994 2175 2994 \n",
       "Q 1775 2994 1565 2701 \n",
       "Q 1356 2409 1356 1850 \n",
       "L 1356 331 \n",
       "L 1856 331 \n",
       "L 1856 0 \n",
       "L 263 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-6e\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSerif-6d\"/>\n",
       "      <use x=\"94.824219\" xlink:href=\"#DejaVuSerif-65\"/>\n",
       "      <use x=\"154.003906\" xlink:href=\"#DejaVuSerif-61\"/>\n",
       "      <use x=\"213.623047\" xlink:href=\"#DejaVuSerif-6e\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_36\">\n",
       "     <path d=\"M 509.798437 34.976562 \n",
       "L 529.798437 34.976562 \n",
       "\" style=\"fill:none;stroke:#bfbf00;stroke-dasharray:6.475,2.8;stroke-dashoffset:0;stroke-width:1.75;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_37\"/>\n",
       "    <g id=\"text_17\">\n",
       "     <!-- sd up -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(537.798437 38.476562)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 359 184 \n",
       "L 359 959 \n",
       "L 691 959 \n",
       "Q 703 588 923 403 \n",
       "Q 1144 219 1575 219 \n",
       "Q 1963 219 2166 364 \n",
       "Q 2369 509 2369 788 \n",
       "Q 2369 1006 2220 1140 \n",
       "Q 2072 1275 1594 1428 \n",
       "L 1178 1569 \n",
       "Q 750 1706 558 1912 \n",
       "Q 366 2119 366 2438 \n",
       "Q 366 2894 700 3153 \n",
       "Q 1034 3413 1625 3413 \n",
       "Q 1888 3413 2178 3344 \n",
       "Q 2469 3275 2778 3144 \n",
       "L 2778 2419 \n",
       "L 2447 2419 \n",
       "Q 2434 2741 2221 2922 \n",
       "Q 2009 3103 1644 3103 \n",
       "Q 1281 3103 1095 2975 \n",
       "Q 909 2847 909 2591 \n",
       "Q 909 2381 1050 2254 \n",
       "Q 1191 2128 1613 1997 \n",
       "L 2069 1856 \n",
       "Q 2541 1709 2748 1489 \n",
       "Q 2956 1269 2956 922 \n",
       "Q 2956 450 2595 179 \n",
       "Q 2234 -91 1600 -91 \n",
       "Q 1278 -91 972 -22 \n",
       "Q 666 47 359 184 \n",
       "z\n",
       "\" id=\"DejaVuSerif-73\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3359 331 \n",
       "L 3909 331 \n",
       "L 3909 0 \n",
       "L 2784 0 \n",
       "L 2784 519 \n",
       "Q 2616 206 2355 57 \n",
       "Q 2094 -91 1709 -91 \n",
       "Q 1097 -91 708 395 \n",
       "Q 319 881 319 1663 \n",
       "Q 319 2444 706 2928 \n",
       "Q 1094 3413 1709 3413 \n",
       "Q 2094 3413 2355 3264 \n",
       "Q 2616 3116 2784 2803 \n",
       "L 2784 4531 \n",
       "L 2241 4531 \n",
       "L 2241 4863 \n",
       "L 3359 4863 \n",
       "L 3359 331 \n",
       "z\n",
       "M 2784 1497 \n",
       "L 2784 1825 \n",
       "Q 2784 2422 2554 2737 \n",
       "Q 2325 3053 1888 3053 \n",
       "Q 1444 3053 1217 2703 \n",
       "Q 991 2353 991 1663 \n",
       "Q 991 975 1217 622 \n",
       "Q 1444 269 1888 269 \n",
       "Q 2325 269 2554 583 \n",
       "Q 2784 897 2784 1497 \n",
       "z\n",
       "\" id=\"DejaVuSerif-64\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSerif-20\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 2266 3322 \n",
       "L 3341 3322 \n",
       "L 3341 331 \n",
       "L 3884 331 \n",
       "L 3884 0 \n",
       "L 2766 0 \n",
       "L 2766 588 \n",
       "Q 2606 256 2353 82 \n",
       "Q 2100 -91 1766 -91 \n",
       "Q 1213 -91 952 223 \n",
       "Q 691 538 691 1209 \n",
       "L 691 2988 \n",
       "L 172 2988 \n",
       "L 172 3322 \n",
       "L 1269 3322 \n",
       "L 1269 1388 \n",
       "Q 1269 781 1417 556 \n",
       "Q 1566 331 1947 331 \n",
       "Q 2347 331 2556 625 \n",
       "Q 2766 919 2766 1478 \n",
       "L 2766 2988 \n",
       "L 2266 2988 \n",
       "L 2266 3322 \n",
       "z\n",
       "\" id=\"DejaVuSerif-75\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1313 1825 \n",
       "L 1313 1497 \n",
       "Q 1313 897 1542 583 \n",
       "Q 1772 269 2209 269 \n",
       "Q 2650 269 2876 622 \n",
       "Q 3103 975 3103 1663 \n",
       "Q 3103 2353 2876 2703 \n",
       "Q 2650 3053 2209 3053 \n",
       "Q 1772 3053 1542 2737 \n",
       "Q 1313 2422 1313 1825 \n",
       "z\n",
       "M 738 2988 \n",
       "L 184 2988 \n",
       "L 184 3322 \n",
       "L 1313 3322 \n",
       "L 1313 2803 \n",
       "Q 1481 3116 1742 3264 \n",
       "Q 2003 3413 2388 3413 \n",
       "Q 3000 3413 3387 2928 \n",
       "Q 3775 2444 3775 1663 \n",
       "Q 3775 881 3387 395 \n",
       "Q 3000 -91 2388 -91 \n",
       "Q 2003 -91 1742 57 \n",
       "Q 1481 206 1313 519 \n",
       "L 1313 -997 \n",
       "L 1856 -997 \n",
       "L 1856 -1331 \n",
       "L 184 -1331 \n",
       "L 184 -997 \n",
       "L 738 -997 \n",
       "L 738 2988 \n",
       "z\n",
       "\" id=\"DejaVuSerif-70\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSerif-73\"/>\n",
       "      <use x=\"51.318359\" xlink:href=\"#DejaVuSerif-64\"/>\n",
       "      <use x=\"115.332031\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "      <use x=\"147.119141\" xlink:href=\"#DejaVuSerif-75\"/>\n",
       "      <use x=\"211.523438\" xlink:href=\"#DejaVuSerif-70\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_38\">\n",
       "     <path d=\"M 509.798437 49.654687 \n",
       "L 529.798437 49.654687 \n",
       "\" style=\"fill:none;stroke:#bfbf00;stroke-dasharray:11.2,2.8,1.75,2.8;stroke-dashoffset:0;stroke-width:1.75;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_39\"/>\n",
       "    <g id=\"text_18\">\n",
       "     <!-- sd down -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(537.798437 53.154687)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 1925 219 \n",
       "Q 2388 219 2623 584 \n",
       "Q 2859 950 2859 1663 \n",
       "Q 2859 2375 2623 2739 \n",
       "Q 2388 3103 1925 3103 \n",
       "Q 1463 3103 1227 2739 \n",
       "Q 991 2375 991 1663 \n",
       "Q 991 950 1228 584 \n",
       "Q 1466 219 1925 219 \n",
       "z\n",
       "M 1925 -91 \n",
       "Q 1200 -91 759 389 \n",
       "Q 319 869 319 1663 \n",
       "Q 319 2456 758 2934 \n",
       "Q 1197 3413 1925 3413 \n",
       "Q 2653 3413 3092 2934 \n",
       "Q 3531 2456 3531 1663 \n",
       "Q 3531 869 3092 389 \n",
       "Q 2653 -91 1925 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-6f\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3072 3322 \n",
       "L 3922 728 \n",
       "L 4672 2988 \n",
       "L 4191 2988 \n",
       "L 4191 3322 \n",
       "L 5394 3322 \n",
       "L 5394 2988 \n",
       "L 5025 2988 \n",
       "L 4038 0 \n",
       "L 3559 0 \n",
       "L 2741 2484 \n",
       "L 1919 0 \n",
       "L 1459 0 \n",
       "L 475 2988 \n",
       "L 103 2988 \n",
       "L 103 3322 \n",
       "L 1606 3322 \n",
       "L 1606 2988 \n",
       "L 1069 2988 \n",
       "L 1813 728 \n",
       "L 2669 3322 \n",
       "L 3072 3322 \n",
       "z\n",
       "\" id=\"DejaVuSerif-77\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSerif-73\"/>\n",
       "      <use x=\"51.318359\" xlink:href=\"#DejaVuSerif-64\"/>\n",
       "      <use x=\"115.332031\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "      <use x=\"147.119141\" xlink:href=\"#DejaVuSerif-64\"/>\n",
       "      <use x=\"211.132812\" xlink:href=\"#DejaVuSerif-6f\"/>\n",
       "      <use x=\"271.337891\" xlink:href=\"#DejaVuSerif-77\"/>\n",
       "      <use x=\"356.933594\" xlink:href=\"#DejaVuSerif-6e\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"patch_42\">\n",
       "     <path d=\"M 509.798437 67.832812 \n",
       "L 529.798437 67.832812 \n",
       "L 529.798437 60.832812 \n",
       "L 509.798437 60.832812 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "    </g>\n",
       "    <g id=\"text_19\">\n",
       "     <!-- frequency -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(537.798437 67.832812)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 2753 4078 \n",
       "L 2450 4078 \n",
       "Q 2447 4313 2317 4434 \n",
       "Q 2188 4556 1941 4556 \n",
       "Q 1619 4556 1487 4379 \n",
       "Q 1356 4203 1356 3750 \n",
       "L 1356 3322 \n",
       "L 2284 3322 \n",
       "L 2284 2988 \n",
       "L 1356 2988 \n",
       "L 1356 331 \n",
       "L 2094 331 \n",
       "L 2094 0 \n",
       "L 231 0 \n",
       "L 231 331 \n",
       "L 781 331 \n",
       "L 781 2988 \n",
       "L 231 2988 \n",
       "L 231 3322 \n",
       "L 781 3322 \n",
       "L 781 3738 \n",
       "Q 781 4294 1070 4578 \n",
       "Q 1359 4863 1919 4863 \n",
       "Q 2128 4863 2337 4825 \n",
       "Q 2547 4788 2753 4709 \n",
       "L 2753 4078 \n",
       "z\n",
       "\" id=\"DejaVuSerif-66\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3059 3328 \n",
       "L 3059 2497 \n",
       "L 2728 2497 \n",
       "Q 2713 2744 2591 2866 \n",
       "Q 2469 2988 2234 2988 \n",
       "Q 1809 2988 1582 2694 \n",
       "Q 1356 2400 1356 1850 \n",
       "L 1356 331 \n",
       "L 2022 331 \n",
       "L 2022 0 \n",
       "L 263 0 \n",
       "L 263 331 \n",
       "L 781 331 \n",
       "L 781 2994 \n",
       "L 231 2994 \n",
       "L 231 3322 \n",
       "L 1356 3322 \n",
       "L 1356 2731 \n",
       "Q 1525 3078 1790 3245 \n",
       "Q 2056 3413 2438 3413 \n",
       "Q 2578 3413 2733 3391 \n",
       "Q 2888 3369 3059 3328 \n",
       "z\n",
       "\" id=\"DejaVuSerif-72\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3359 2988 \n",
       "L 3359 -997 \n",
       "L 3909 -997 \n",
       "L 3909 -1331 \n",
       "L 2241 -1331 \n",
       "L 2241 -997 \n",
       "L 2784 -997 \n",
       "L 2784 519 \n",
       "Q 2616 206 2355 57 \n",
       "Q 2094 -91 1709 -91 \n",
       "Q 1097 -91 708 395 \n",
       "Q 319 881 319 1663 \n",
       "Q 319 2444 706 2928 \n",
       "Q 1094 3413 1709 3413 \n",
       "Q 2094 3413 2355 3264 \n",
       "Q 2616 3116 2784 2803 \n",
       "L 2784 3322 \n",
       "L 3909 3322 \n",
       "L 3909 2988 \n",
       "L 3359 2988 \n",
       "z\n",
       "M 2784 1825 \n",
       "Q 2784 2422 2554 2737 \n",
       "Q 2325 3053 1888 3053 \n",
       "Q 1444 3053 1217 2703 \n",
       "Q 991 2353 991 1663 \n",
       "Q 991 975 1217 622 \n",
       "Q 1444 269 1888 269 \n",
       "Q 2325 269 2554 583 \n",
       "Q 2784 897 2784 1497 \n",
       "L 2784 1825 \n",
       "z\n",
       "\" id=\"DejaVuSerif-71\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 3291 997 \n",
       "Q 3169 466 2822 187 \n",
       "Q 2475 -91 1925 -91 \n",
       "Q 1200 -91 759 389 \n",
       "Q 319 869 319 1663 \n",
       "Q 319 2459 759 2936 \n",
       "Q 1200 3413 1925 3413 \n",
       "Q 2241 3413 2553 3339 \n",
       "Q 2866 3266 3181 3116 \n",
       "L 3181 2266 \n",
       "L 2847 2266 \n",
       "Q 2781 2703 2561 2903 \n",
       "Q 2341 3103 1931 3103 \n",
       "Q 1466 3103 1228 2742 \n",
       "Q 991 2381 991 1663 \n",
       "Q 991 944 1227 581 \n",
       "Q 1463 219 1931 219 \n",
       "Q 2303 219 2525 412 \n",
       "Q 2747 606 2828 997 \n",
       "L 3291 997 \n",
       "z\n",
       "\" id=\"DejaVuSerif-63\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1381 -609 \n",
       "L 1600 -56 \n",
       "L 359 2988 \n",
       "L -19 2988 \n",
       "L -19 3322 \n",
       "L 1509 3322 \n",
       "L 1509 2988 \n",
       "L 978 2988 \n",
       "L 1913 703 \n",
       "L 2847 2988 \n",
       "L 2350 2988 \n",
       "L 2350 3322 \n",
       "L 3597 3322 \n",
       "L 3597 2988 \n",
       "L 3225 2988 \n",
       "L 1703 -750 \n",
       "Q 1547 -1138 1356 -1280 \n",
       "Q 1166 -1422 819 -1422 \n",
       "Q 672 -1422 517 -1397 \n",
       "Q 363 -1372 206 -1325 \n",
       "L 206 -691 \n",
       "L 500 -691 \n",
       "Q 519 -903 608 -995 \n",
       "Q 697 -1088 884 -1088 \n",
       "Q 1056 -1088 1161 -992 \n",
       "Q 1266 -897 1381 -609 \n",
       "z\n",
       "\" id=\"DejaVuSerif-79\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSerif-66\"/>\n",
       "      <use x=\"37.011719\" xlink:href=\"#DejaVuSerif-72\"/>\n",
       "      <use x=\"84.814453\" xlink:href=\"#DejaVuSerif-65\"/>\n",
       "      <use x=\"143.994141\" xlink:href=\"#DejaVuSerif-71\"/>\n",
       "      <use x=\"208.007812\" xlink:href=\"#DejaVuSerif-75\"/>\n",
       "      <use x=\"272.412109\" xlink:href=\"#DejaVuSerif-65\"/>\n",
       "      <use x=\"331.591797\" xlink:href=\"#DejaVuSerif-6e\"/>\n",
       "      <use x=\"395.996094\" xlink:href=\"#DejaVuSerif-63\"/>\n",
       "      <use x=\"452.001953\" xlink:href=\"#DejaVuSerif-79\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p63270f2772\">\n",
       "   <rect height=\"326.16\" width=\"558\" x=\"39.65\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "ST = S[-1]\n",
    "plt.figure(figsize=(10, 6))\n",
    "plt.hist(ST, bins=35, color='b', label='frequency');\n",
    "plt.axvline(ST.mean(), color='r', label='mean')\n",
    "plt.axvline(ST.mean() + ST.std(), ls='--', color='y', label='sd up')\n",
    "plt.axvline(ST.mean() - ST.std(), ls='-.', color='y', label='sd down')\n",
    "plt.legend(loc=0);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "38.22611567563295"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "S0 * math.exp(r * T)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "38.25248936738523"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ST.mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### European Option Pricing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  0.000,   1.501,   0.000, ...,   0.800,   0.000,   0.000])"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "h = np.maximum(K - ST, 0)\n",
    "h"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"357.238125pt\" version=\"1.1\" viewBox=\"0 0 614.175502 357.238125\" width=\"614.175502pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-10-19T11:05:26.496915</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.1, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 357.238125 \n",
       "L 614.175502 357.238125 \n",
       "L 614.175502 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 46.0125 333.36 \n",
       "L 604.0125 333.36 \n",
       "L 604.0125 7.2 \n",
       "L 46.0125 7.2 \n",
       "z\n",
       "\" style=\"fill:#eaeaf2;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 71.376136 333.36 \n",
       "L 71.376136 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\"/>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(68.194886 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 219 \n",
       "Q 2513 219 2750 744 \n",
       "Q 2988 1269 2988 2328 \n",
       "Q 2988 3391 2750 3916 \n",
       "Q 2513 4441 2034 4441 \n",
       "Q 1556 4441 1318 3916 \n",
       "Q 1081 3391 1081 2328 \n",
       "Q 1081 1269 1318 744 \n",
       "Q 1556 219 2034 219 \n",
       "z\n",
       "M 2034 -91 \n",
       "Q 1275 -91 848 546 \n",
       "Q 422 1184 422 2328 \n",
       "Q 422 3475 848 4112 \n",
       "Q 1275 4750 2034 4750 \n",
       "Q 2797 4750 3222 4112 \n",
       "Q 3647 3475 3647 2328 \n",
       "Q 3647 1184 3222 546 \n",
       "Q 2797 -91 2034 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 177.22351 333.36 \n",
       "L 177.22351 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_4\"/>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 5 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(174.04226 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3219 4666 \n",
       "L 3219 4153 \n",
       "L 1081 4153 \n",
       "L 1081 2816 \n",
       "Q 1244 2928 1461 2984 \n",
       "Q 1678 3041 1947 3041 \n",
       "Q 2703 3041 3140 2622 \n",
       "Q 3578 2203 3578 1478 \n",
       "Q 3578 738 3136 323 \n",
       "Q 2694 -91 1894 -91 \n",
       "Q 1572 -91 1234 -12 \n",
       "Q 897 66 544 225 \n",
       "L 544 1131 \n",
       "L 897 1131 \n",
       "Q 925 688 1179 453 \n",
       "Q 1434 219 1894 219 \n",
       "Q 2388 219 2653 544 \n",
       "Q 2919 869 2919 1478 \n",
       "Q 2919 2084 2655 2407 \n",
       "Q 2391 2731 1894 2731 \n",
       "Q 1613 2731 1398 2631 \n",
       "Q 1184 2531 1019 2322 \n",
       "L 750 2322 \n",
       "L 750 4666 \n",
       "L 3219 4666 \n",
       "z\n",
       "\" id=\"DejaVuSerif-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 283.070883 333.36 \n",
       "L 283.070883 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_6\"/>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 10 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(276.708383 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 909 0 \n",
       "L 909 331 \n",
       "L 1722 331 \n",
       "L 1722 4213 \n",
       "L 781 3603 \n",
       "L 781 4013 \n",
       "L 1919 4750 \n",
       "L 2350 4750 \n",
       "L 2350 331 \n",
       "L 3163 331 \n",
       "L 3163 0 \n",
       "L 909 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 388.918256 333.36 \n",
       "L 388.918256 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\"/>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 15 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(382.555756 347.958438)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 494.765629 333.36 \n",
       "L 494.765629 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\"/>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 20 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(488.403129 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 819 3553 \n",
       "L 469 3553 \n",
       "L 469 4384 \n",
       "Q 803 4563 1142 4656 \n",
       "Q 1481 4750 1806 4750 \n",
       "Q 2534 4750 2956 4397 \n",
       "Q 3378 4044 3378 3438 \n",
       "Q 3378 2753 2422 1800 \n",
       "Q 2347 1728 2309 1691 \n",
       "L 1131 513 \n",
       "L 3078 513 \n",
       "L 3078 1088 \n",
       "L 3444 1088 \n",
       "L 3444 0 \n",
       "L 434 0 \n",
       "L 434 341 \n",
       "L 1850 1753 \n",
       "Q 2319 2222 2519 2614 \n",
       "Q 2719 3006 2719 3438 \n",
       "Q 2719 3909 2473 4175 \n",
       "Q 2228 4441 1797 4441 \n",
       "Q 1350 4441 1106 4219 \n",
       "Q 863 3997 819 3553 \n",
       "z\n",
       "\" id=\"DejaVuSerif-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 600.613002 333.36 \n",
       "L 600.613002 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\"/>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 25 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(594.250502 347.958438)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 46.0125 333.36 \n",
       "L 604.0125 333.36 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\"/>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(32.65 337.159219)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 46.0125 295.172971 \n",
       "L 604.0125 295.172971 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\"/>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 2500 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(13.5625 298.972189)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 46.0125 256.985941 \n",
       "L 604.0125 256.985941 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_18\"/>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 5000 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(13.5625 260.78516)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-35\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 46.0125 218.798912 \n",
       "L 604.0125 218.798912 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_20\"/>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 7500 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(13.5625 222.598131)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3609 4347 \n",
       "L 1784 0 \n",
       "L 1319 0 \n",
       "L 3059 4153 \n",
       "L 903 4153 \n",
       "L 903 3578 \n",
       "L 538 3578 \n",
       "L 538 4666 \n",
       "L 3609 4666 \n",
       "L 3609 4347 \n",
       "z\n",
       "\" id=\"DejaVuSerif-37\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-37\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_21\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 46.0125 180.611883 \n",
       "L 604.0125 180.611883 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_22\"/>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 10000 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 184.411101)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_23\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 46.0125 142.424853 \n",
       "L 604.0125 142.424853 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_24\"/>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 12500 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 146.224072)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_25\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 46.0125 104.237824 \n",
       "L 604.0125 104.237824 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_26\"/>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 15000 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 108.037043)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_8\">\n",
       "     <g id=\"line2d_27\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 46.0125 66.050795 \n",
       "L 604.0125 66.050795 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_28\"/>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 17500 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 69.850013)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-37\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_9\">\n",
       "     <g id=\"line2d_29\">\n",
       "      <path clip-path=\"url(#p10507af12d)\" d=\"M 46.0125 27.863765 \n",
       "L 604.0125 27.863765 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_30\"/>\n",
       "     <g id=\"text_15\">\n",
       "      <!-- 20000 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 31.662984)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 71.376136 333.36 \n",
       "L 85.869643 333.36 \n",
       "L 85.869643 22.731429 \n",
       "L 71.376136 22.731429 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 85.869643 333.36 \n",
       "L 100.363149 333.36 \n",
       "L 100.363149 306.415232 \n",
       "L 85.869643 306.415232 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 100.363149 333.36 \n",
       "L 114.856656 333.36 \n",
       "L 114.856656 305.636217 \n",
       "L 100.363149 305.636217 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 114.856656 333.36 \n",
       "L 129.350162 333.36 \n",
       "L 129.350162 305.39182 \n",
       "L 114.856656 305.39182 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_7\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 129.350162 333.36 \n",
       "L 143.843669 333.36 \n",
       "L 143.843669 306.369408 \n",
       "L 129.350162 306.369408 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_8\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 143.843669 333.36 \n",
       "L 158.337175 333.36 \n",
       "L 158.337175 303.955987 \n",
       "L 143.843669 303.955987 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_9\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 158.337175 333.36 \n",
       "L 172.830682 333.36 \n",
       "L 172.830682 305.116873 \n",
       "L 158.337175 305.116873 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_10\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 172.830682 333.36 \n",
       "L 187.324188 333.36 \n",
       "L 187.324188 306.201385 \n",
       "L 172.830682 306.201385 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_11\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 187.324188 333.36 \n",
       "L 201.817695 333.36 \n",
       "L 201.817695 306.079186 \n",
       "L 187.324188 306.079186 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_12\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 201.817695 333.36 \n",
       "L 216.311201 333.36 \n",
       "L 216.311201 306.858202 \n",
       "L 201.817695 306.858202 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_13\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 216.311201 333.36 \n",
       "L 230.804708 333.36 \n",
       "L 230.804708 307.80524 \n",
       "L 216.311201 307.80524 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_14\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 230.804708 333.36 \n",
       "L 245.298214 333.36 \n",
       "L 245.298214 309.714591 \n",
       "L 230.804708 309.714591 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_15\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 245.298214 333.36 \n",
       "L 259.791721 333.36 \n",
       "L 259.791721 311.058775 \n",
       "L 245.298214 311.058775 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_16\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 259.791721 333.36 \n",
       "L 274.285227 333.36 \n",
       "L 274.285227 311.86834 \n",
       "L 259.791721 311.86834 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_17\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 274.285227 333.36 \n",
       "L 288.778734 333.36 \n",
       "L 288.778734 315.198249 \n",
       "L 274.285227 315.198249 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_18\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 288.778734 333.36 \n",
       "L 303.27224 333.36 \n",
       "L 303.27224 316.511883 \n",
       "L 288.778734 316.511883 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_19\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 303.27224 333.36 \n",
       "L 317.765747 333.36 \n",
       "L 317.765747 318.528158 \n",
       "L 303.27224 318.528158 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_20\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 317.765747 333.36 \n",
       "L 332.259253 333.36 \n",
       "L 332.259253 320.34586 \n",
       "L 317.765747 320.34586 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_21\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 332.259253 333.36 \n",
       "L 346.75276 333.36 \n",
       "L 346.75276 322.728731 \n",
       "L 332.259253 322.728731 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_22\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 346.75276 333.36 \n",
       "L 361.246266 333.36 \n",
       "L 361.246266 324.347861 \n",
       "L 346.75276 324.347861 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_23\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 361.246266 333.36 \n",
       "L 375.739773 333.36 \n",
       "L 375.739773 325.829518 \n",
       "L 361.246266 325.829518 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_24\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 375.739773 333.36 \n",
       "L 390.233279 333.36 \n",
       "L 390.233279 326.929304 \n",
       "L 375.739773 326.929304 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_25\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 390.233279 333.36 \n",
       "L 404.726786 333.36 \n",
       "L 404.726786 329.067778 \n",
       "L 390.233279 329.067778 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_26\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 404.726786 333.36 \n",
       "L 419.220292 333.36 \n",
       "L 419.220292 329.67877 \n",
       "L 404.726786 329.67877 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_27\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 419.220292 333.36 \n",
       "L 433.713799 333.36 \n",
       "L 433.713799 330.961855 \n",
       "L 419.220292 330.961855 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_28\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 433.713799 333.36 \n",
       "L 448.207305 333.36 \n",
       "L 448.207305 331.695046 \n",
       "L 433.713799 331.695046 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_29\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 448.207305 333.36 \n",
       "L 462.700812 333.36 \n",
       "L 462.700812 331.893618 \n",
       "L 448.207305 331.893618 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_30\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 462.700812 333.36 \n",
       "L 477.194318 333.36 \n",
       "L 477.194318 332.687908 \n",
       "L 462.700812 332.687908 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_31\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 477.194318 333.36 \n",
       "L 491.687825 333.36 \n",
       "L 491.687825 332.825382 \n",
       "L 477.194318 332.825382 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_32\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 491.687825 333.36 \n",
       "L 506.181331 333.36 \n",
       "L 506.181331 333.039229 \n",
       "L 491.687825 333.039229 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_33\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 506.181331 333.36 \n",
       "L 520.674838 333.36 \n",
       "L 520.674838 333.161427 \n",
       "L 506.181331 333.161427 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_34\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 520.674838 333.36 \n",
       "L 535.168344 333.36 \n",
       "L 535.168344 333.298901 \n",
       "L 520.674838 333.298901 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_35\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 535.168344 333.36 \n",
       "L 549.661851 333.36 \n",
       "L 549.661851 333.237802 \n",
       "L 535.168344 333.237802 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_36\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 549.661851 333.36 \n",
       "L 564.155357 333.36 \n",
       "L 564.155357 333.344725 \n",
       "L 549.661851 333.344725 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_37\">\n",
       "    <path clip-path=\"url(#p10507af12d)\" d=\"M 564.155357 333.36 \n",
       "L 578.648864 333.36 \n",
       "L 578.648864 333.344725 \n",
       "L 564.155357 333.344725 \n",
       "z\n",
       "\" style=\"fill:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_38\">\n",
       "    <path d=\"M 46.0125 333.36 \n",
       "L 46.0125 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_39\">\n",
       "    <path d=\"M 604.0125 333.36 \n",
       "L 604.0125 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_40\">\n",
       "    <path d=\"M 46.0125 333.36 \n",
       "L 604.0125 333.36 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_41\">\n",
       "    <path d=\"M 46.0125 7.2 \n",
       "L 604.0125 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p10507af12d\">\n",
       "   <rect height=\"326.16\" width=\"558\" x=\"46.0125\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(10, 6))\n",
    "plt.hist(h, color='b', bins=35);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.818117261795047"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "math.exp(-r * T) * h.mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### American Option Pricing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "h = np.maximum(K - S, 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Least-Squares Monte Carlo Valuation (LSM algorithm)\n",
    "V = h[-1]\n",
    "for t in range(M - 1, 0, -1):\n",
    "    reg = np.polyfit(S[t], df * V, deg=5)\n",
    "    C = np.polyval(reg, S[t])\n",
    "    V = np.where(h[t] > C, h[t], df * V)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.454837750511421"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df * V.mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"http://hilpisch.com/tpq_logo.png\" alt=\"The Python Quants\" width=\"35%\" align=\"right\" border=\"0\"><br>\n",
    "\n",
    "<a href=\"http://tpq.io\" target=\"_blank\">http://tpq.io</a> | <a href=\"http://twitter.com/dyjh\" target=\"_blank\">@dyjh</a> | <a href=\"mailto:training@tpq.io\">training@tpq.io</a>"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
